Skip to content

Commit f90b474

Browse files
tehcasterAlexei Starovoitov
authored andcommitted
mm: Fix the flipped condition in gfpflags_allow_spinning()
The function gfpflags_allow_spinning() has a bug that makes it return the opposite result than intended. This could contribute to deadlocks as usage profilerates, for now it was noticed as a performance regression due to try_charge_memcg() not refilling memcg stock when it could. Fix the flipped condition. Fixes: 97769a5 ("mm, bpf: Introduce try_alloc_pages() for opportunistic page allocation") Reported-by: kernel test robot <oliver.sang@intel.com> Acked-by: Shakeel Butt <shakeel.butt@linux.dev> Signed-off-by: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20250310124017.187-1-alexei.starovoitov@gmail.com Closes: https://lore.kernel.org/oe-lkp/202503101254.cfd454df-lkp@intel.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
1 parent 93ed6fc commit f90b474

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/gfp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static inline bool gfpflags_allow_spinning(const gfp_t gfp_flags)
5555
* regular page allocator doesn't fully support this
5656
* allocation mode.
5757
*/
58-
return !(gfp_flags & __GFP_RECLAIM);
58+
return !!(gfp_flags & __GFP_RECLAIM);
5959
}
6060

6161
#ifdef CONFIG_HIGHMEM

0 commit comments

Comments
 (0)