From: Davidlohr Bueso Date: Tue, 6 Aug 2024 15:39:27 +0000 (-0700) Subject: lib/rhashtable: cleanup fallback check in bucket_table_alloc() X-Git-Tag: v6.12-rc1~114^2~60 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a15bec6a8f2f177e6c1388f23d02436e27994299;p=thirdparty%2Fkernel%2Flinux.git 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 Suggested-by: Michal Hocko Cc: Davidlohr Bueso Cc: Herbert Xu Signed-off-by: Andrew Morton --- diff --git a/lib/rhashtable.c b/lib/rhashtable.c index dbbed19f8fff9..6c902639728b7 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c @@ -189,7 +189,7 @@ static struct bucket_table *bucket_table_alloc(struct rhashtable *ht, size = nbuckets; - if (tbl == NULL && (gfp & ~__GFP_NOFAIL) != GFP_KERNEL) { + if (tbl == NULL && !gfpflags_allow_blocking(gfp)) { tbl = nested_bucket_table_alloc(ht, nbuckets, gfp); nbuckets = 0; }