On Sun, Oct 20, 2024 at 03:16:11PM -0400, Kent Overstreet wrote:
> On Sun, Oct 20, 2024 at 12:09:58PM -0700, Linus Torvalds wrote:
> > On Sun, 20 Oct 2024 at 12:09, Linus Torvalds
> > <[email protected]> wrote:
> > >
> > > How about you limit the amount of memory you use in the first place 
> > > instead?
> > 
> > .. and to clarify: we're not making other parts of the kernel less
> > robust because *you* are doing something stupid and odd.
> 
> Except, vmalloc() already behaves this way - so it seems to me you
> already have.
> 
> I've already added a stupid workaround to the darray code to switch to
> calling vmalloc() directly, when necessary; this patch was a courtesy
> because if bcachefs is hitting this limit no doubt other things will be
> soon as well.
>
I was thinking to prevent "big" allocations to limit the vmalloc() by
the INT_MAX sizes, i.e. to apply same limitation as kvmalloc() has.
vmalloc() is stick to totalram_pages() which is way a lot.

But it would break bcachefs, as i see it.

--
Uladzislau Rezki

Reply via email to