Thread (99 messages) 99 messages, 9 authors, 2024-08-30

Re: [PATCH v3 3/4] mm: BUG_ON to avoid NULL deference while __GFP_NOFAIL fails

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2024-08-19 17:17:47
Also in: linux-mm

On Mon, 19 Aug 2024 at 10:12, Michal Hocko [off-list ref] wrote:
Whether to BUG_ON or simply loop for ever in the allocator if somebody
requests non-sleeping NOFAIL allocation is a different story.
Just return NULL.

The bug isn't in the VM. It's in the caller. Don't take on other
peoples problems.

It was never valid to say "I want to allocate lots of memory and you
can't fail".

Don't validate that kind of bogus behavior, just tell them "you're
bad" and return NULL.

            Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help