[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240806153927.184515-1-dave@stgolabs.net>
Date: Tue, 6 Aug 2024 08:39:27 -0700
From: Davidlohr Bueso <dave@...olabs.net>
To: akpm@...ux-foundation.org
Cc: mhocko@...nel.org,
21cnbao@...il.com,
herbert@...dor.apana.org.au,
dave@...olabs.net,
linux-kernel@...r.kernel.org,
Michal Hocko <mhocko@...e.com>
Subject: [PATCH] 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.
Suggested-by: Michal Hocko <mhocko@...e.com>
Signed-off-by: Davidlohr Bueso <dave@...olabs.net>
---
lib/rhashtable.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/rhashtable.c b/lib/rhashtable.c
index dbbed19f8fff..6c902639728b 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;
}
--
2.45.2
Powered by blists - more mailing lists