Re: [PATCH v4] slab: Ignore internal flags in cache creation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 5 Oct 2012, Glauber Costa wrote:

> diff --git a/mm/slab.h b/mm/slab.h
> index 7deeb44..4c35c17 100644
> --- a/mm/slab.h
> +++ b/mm/slab.h
> @@ -45,6 +45,31 @@ static inline struct kmem_cache *__kmem_cache_alias(const char *name, size_t siz
>  #endif
>  
>  
> +/* Legal flag mask for kmem_cache_create(), for various configurations */
> +#define SLAB_CORE_FLAGS (SLAB_HWCACHE_ALIGN | SLAB_CACHE_DMA | SLAB_PANIC | \
> +			 SLAB_DESTROY_BY_RCU | SLAB_DEBUG_OBJECTS )
> +
> +#if defined(CONFIG_DEBUG_SLAB)
> +#define SLAB_DEBUG_FLAGS (SLAB_RED_ZONE | SLAB_POISON | SLAB_STORE_USER)
> +#elif defined(CONFIG_SLUB_DEBUG)
> +#define SLAB_DEBUG_FLAGS (SLAB_RED_ZONE | SLAB_POISON | SLAB_STORE_USER | \
> +			  SLAB_TRACE | SLAB_DEBUG_FREE)
> +#else
> +#define SLAB_DEBUG_FLAGS (0)
> +#endif
> +
> +#if defined(CONFIG_SLAB)
> +#define SLAB_CACHE_FLAGS (SLAB_MEMSPREAD | SLAB_NOLEAKTRACE | \

s/SLAB_MEMSPREAD/SLAB_MEM_SPREAD/

> +			  SLAB_RECLAIM_ACCOUNT | SLAB_TEMPORARY | SLAB_NOTRACK)
> +#elif defined(CONFIG_SLUB)
> +#define SLAB_CACHE_FLAGS (SLAB_NOLEAKTRACE | SLAB_RECLAIM_ACCOUNT | \
> +			  SLAB_TEMPORARY | SLAB_NOTRACK)
> +#else
> +#define SLAB_CACHE_FLAGS (0)
> +#endif
> +
> +#define CACHE_CREATE_MASK (SLAB_CORE_FLAGS | SLAB_DEBUG_FLAGS | SLAB_CACHE_FLAGS)
> +
>  int __kmem_cache_shutdown(struct kmem_cache *);
>  
>  #endif

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]