lkml.org 
[lkml]   [2018]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [External] Re: [RFC PATCH v2 10/12] mm/zsmalloc: update usage of address zone modifiers
Date
From: owner-linux-mm@kvack.org On Behalf Of Matthew Wilcox
>
> On Mon, May 21, 2018 at 11:20:31PM +0800, Huaisheng Ye wrote:
> > @@ -343,7 +343,7 @@ static void destroy_cache(struct zs_pool *pool)
> > static unsigned long cache_alloc_handle(struct zs_pool *pool, gfp_t gfp)
> > {
> > return (unsigned long)kmem_cache_alloc(pool->handle_cachep,
> > - gfp & ~(__GFP_HIGHMEM|__GFP_MOVABLE));
> > + gfp & ~__GFP_ZONE_MOVABLE);
> > }
>
> This should be & ~GFP_ZONEMASK
>
> Actually, we should probably have a function to clear those bits rather
> than have every driver manipulating the gfp mask like this. Maybe
>
> #define gfp_normal(gfp) ((gfp) & ~GFP_ZONEMASK)

Good idea!

>
> return (unsigned long)kmem_cache_alloc(pool->handle_cachep,
> - gfp & ~(__GFP_HIGHMEM|__GFP_MOVABLE));
> + gfp_normal(gfp));


Sincerely,
Huaisheng Ye

\
 
 \ /
  Last update: 2018-05-22 13:52    [W:0.053 / U:3.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site