Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

lib/rhashtable: cleanup fallback check in bucket_table_alloc()

Upon allocation failure, the current check with the nofail bits is
unnecessary, and further stands in the way of discouraging direct use of
__GFP_NOFAIL. Remove this and replace with the proper way of determining
if doing a non-blocking allocation for the nested table case.

Link: https://lkml.kernel.org/r/20240806153927.184515-1-dave@stgolabs.net
Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Suggested-by: Michal Hocko <mhocko@suse.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Davidlohr Bueso and committed by
Andrew Morton
a15bec6a 97cf8f5f

+1 -1
+1 -1
lib/rhashtable.c
··· 189 189 190 190 size = nbuckets; 191 191 192 - if (tbl == NULL && (gfp & ~__GFP_NOFAIL) != GFP_KERNEL) { 192 + if (tbl == NULL && !gfpflags_allow_blocking(gfp)) { 193 193 tbl = nested_bucket_table_alloc(ht, nbuckets, gfp); 194 194 nbuckets = 0; 195 195 }