lkml.org 
[lkml]   [2018]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/4] lib/rhashtable: simplify bucket_table_alloc()
On Thu, Jun 21 2018, Davidlohr Bueso wrote:

> As of ce91f6ee5 (mm: kvmalloc does not fallback to vmalloc for incompatible gfp flag),
> we can simplify the caller and trust kvzalloc() to just do the right thing.

Hi,
it isn't clear to me that this is true.
With this change we lose __GFP_NOWARN and __GFP_NORETRY.
I doubt the NORETRY is particularly important as this is if it
isn't GFP_KERNEL, then it is GFP_ATOMIC which doesn't retry anyway.
However I cannot see why this patch won't result in warnings when the
kzalloc() fails.
What am I missing?

Thanks,
NeilBrown


>
> Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
> ---
> lib/rhashtable.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/lib/rhashtable.c b/lib/rhashtable.c
> index 9427b5766134..26c9cd8a985a 100644
> --- a/lib/rhashtable.c
> +++ b/lib/rhashtable.c
> @@ -175,10 +175,7 @@ static struct bucket_table *bucket_table_alloc(struct rhashtable *ht,
> int i;
>
> size = sizeof(*tbl) + nbuckets * sizeof(tbl->buckets[0]);
> - if (gfp != GFP_KERNEL)
> - tbl = kzalloc(size, gfp | __GFP_NOWARN | __GFP_NORETRY);
> - else
> - tbl = kvzalloc(size, gfp);
> + tbl = kvzalloc(size, gfp);
>
> size = nbuckets;
>
> --
> 2.16.4
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2018-06-22 08:05    [W:1.598 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site