lkml.org 
[lkml]   [2012]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] slab: Ignore internal flags in cache creation
On Mon, 1 Oct 2012, Glauber Costa wrote:

> diff --git a/mm/slab_common.c b/mm/slab_common.c
> index 9c21725..f2682ee 100644
> --- a/mm/slab_common.c
> +++ b/mm/slab_common.c
> @@ -107,6 +107,15 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size, size_t align
> if (!kmem_cache_sanity_check(name, size) == 0)
> goto out_locked;
>
> + /*
> + * Some allocators will constraint the set of valid flags to a subset
> + * of all flags. We expect them to define CACHE_CREATE_MASK in this
> + * case, and we'll just provide them with a sanitized version of the
> + * passed flags.
> + */
> +#ifdef CACHE_CREATE_MASK
> + flags &= ~CACHE_CREATE_MASK;
> +#endif
>
> s = __kmem_cache_alias(name, size, align, flags, ctor);
> if (s)

flags &= CACHE_CREATE_MASK

After that's done:

Acked-by: David Rientjes <rientjes@google.com>

Thanks for working through this.


\
 
 \ /
  Last update: 2012-10-02 06:01    [W:0.043 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site