]> Git Repo - linux.git/commitdiff
debugobjects: Don't wake up kswapd from fill_pool()
authorTetsuo Handa <[email protected]>
Thu, 11 May 2023 13:47:32 +0000 (22:47 +0900)
committerThomas Gleixner <[email protected]>
Mon, 22 May 2023 12:52:58 +0000 (14:52 +0200)
syzbot is reporting a lockdep warning in fill_pool() because the allocation
from debugobjects is using GFP_ATOMIC, which is (__GFP_HIGH | __GFP_KSWAPD_RECLAIM)
and therefore tries to wake up kswapd, which acquires kswapd_wait::lock.

Since fill_pool() might be called with arbitrary locks held, fill_pool()
should not assume that acquiring kswapd_wait::lock is safe.

Use __GFP_HIGH instead and remove __GFP_NORETRY as it is pointless for
!__GFP_DIRECT_RECLAIM allocation.

Fixes: 3ac7fe5a4aab ("infrastructure to debug (dynamic) objects")
Reported-by: syzbot <[email protected]>
Signed-off-by: Tetsuo Handa <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Closes: https://syzkaller.appspot.com/bug?extid=fe0c72f0ccbb93786380
lib/debugobjects.c

index 826c617b10a7582069c8f90d3020701344282046..984985c39c9b00855ea601562223548e085ced61 100644 (file)
@@ -126,7 +126,7 @@ static const char *obj_states[ODEBUG_STATE_MAX] = {
 
 static void fill_pool(void)
 {
-       gfp_t gfp = GFP_ATOMIC | __GFP_NORETRY | __GFP_NOWARN;
+       gfp_t gfp = __GFP_HIGH | __GFP_NOWARN;
        struct debug_obj *obj;
        unsigned long flags;
 
This page took 0.057069 seconds and 4 git commands to generate.