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 20:35:46
Also in: linux-mm

On Mon, 19 Aug 2024 at 13:24, David Hildenbrand [off-list ref] wrote:
Right, "warn + loop forever" is one alternative where you could at least
keep the system alive to some degree.
Maybe. Or it might just lock up the machine.

For small allocations looping forever is probably fine, because in
practice there's always *something* that can be thrown out.

But anything larger than order-3 (handwavy, but that was our
historical limit, I think, and we call it PAGE_ALLOC_COSTLY_ORDER) has
to fail at _some_ point, and the caller setting GFP_NOFAIL is just
fantasy and "Daddy, I want a pony", and should be ignored.

With a WARN_ON_ONCE(), by all means, so that people can see who the
fantasist is.

            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