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

Re: [PATCH v3 4/4] mm: prohibit NULL deference exposed for unsupported non-blockable __GFP_NOFAIL

From: Michal Hocko <mhocko@suse.com>
Date: 2024-08-19 10:19:35
Also in: linux-mm

On Mon 19-08-24 11:44:39, David Hildenbrand wrote:
[...]
quoted
  	if (gfp_mask & __GFP_NOFAIL) {
  		/*
-		 * All existing users of the __GFP_NOFAIL are blockable, so warn
-		 * of any new users that actually require GFP_NOWAIT
+		 * All existing users of the __GFP_NOFAIL are blockable
+		 * otherwise we introduce a busy loop with inside the page
+		 * allocator from non-sleepable contexts
  		 */
-		if (WARN_ON_ONCE_GFP(!can_direct_reclaim, gfp_mask))
-			goto fail;
+		BUG_ON(!can_direct_reclaim);
No new BUG_ON(), WARN_ON_ONCE() is good enough for something that should be
found during ordinary testing.
Do you mean 
	if (WARN_ON_ONCE_GFP(...))
		goto retry?

Barry has mentioned that option in the changelog. 
-- 
Michal Hocko
SUSE Labs
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help