History

debugobjects: Don't wake up kswapd from fill_pool()

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.

Tetsuo Handa committed 3 years ago

Commit eb799271 parent 0cce06b1 file · +1 −1Browse files

Showing the changes to lib/debugobjects.c (1 of 1 file). Show all

Unified · Split

lib/debugobjects.c+1−1
@@ -126,7 +126,7 @@ static const char *obj_states[ODEBUG_STATE_MAX] = { · 125 unmodified lines
126 126
127static void fill_pool(void)127static void fill_pool(void)
128{128{
129 gfp_t gfp = GFP_ATOMIC | __GFP_NORETRY | __GFP_NOWARN;129 gfp_t gfp = __GFP_HIGH | __GFP_NOWARN;
130 struct debug_obj *obj;130 struct debug_obj *obj;
131 unsigned long flags;131 unsigned long flags;
132 132

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t