Re: [PATCH v2] mm: Restructure kmem_cache_create() to move debug cache integrity checks into a new function

2012-08-09 Thread Shuah Khan
On Thu, 2012-08-09 at 14:08 -0500, Christoph Lameter (Open Source) wrote: > On Thu, 9 Aug 2012, Shuah Khan wrote: > > > Moving these checks into kmem_cache_sanity_check() would mean return > > path handling will change. The first block of sanity checks for name, > > and size etc. are done before

Re: [PATCH v2] mm: Restructure kmem_cache_create() to move debug cache integrity checks into a new function

2012-08-09 Thread Christoph Lameter (Open Source)
On Thu, 9 Aug 2012, Shuah Khan wrote: > Moving these checks into kmem_cache_sanity_check() would mean return > path handling will change. The first block of sanity checks for name, > and size etc. are done before holding the slab_mutex and the second > block that checks the slab lists is done

Re: [PATCH v2] mm: Restructure kmem_cache_create() to move debug cache integrity checks into a new function

2012-08-09 Thread Shuah Khan
On Thu, 2012-08-09 at 09:13 -0500, Christoph Lameter (Open Source) wrote: > On Mon, 6 Aug 2012, Shuah Khan wrote: > > > +#ifdef CONFIG_DEBUG_VM > > +static int kmem_cache_sanity_check(const char *name, size_t size) > > Why do we pass "size" in? AFAICT there is no need to. It is an oversight on

Re: [PATCH v2] mm: Restructure kmem_cache_create() to move debug cache integrity checks into a new function

2012-08-09 Thread Christoph Lameter (Open Source)
On Mon, 6 Aug 2012, Shuah Khan wrote: > +#ifdef CONFIG_DEBUG_VM > +static int kmem_cache_sanity_check(const char *name, size_t size) Why do we pass "size" in? AFAICT there is no need to. > @@ -53,48 +93,17 @@ struct kmem_cache *kmem_cache_create(const char *name, > size_t size, size_t align >

Re: [PATCH v2] mm: Restructure kmem_cache_create() to move debug cache integrity checks into a new function

2012-08-09 Thread Shuah Khan
On Mon, 2012-08-06 at 15:13 -0600, Shuah Khan wrote: > kmem_cache_create() does cache integrity checks when CONFIG_DEBUG_VM > is defined. These checks interspersed with the regular code path has > lead to compile time warnings when compiled without CONFIG_DEBUG_VM > defined. Restructuring the code

Re: [PATCH v2] mm: Restructure kmem_cache_create() to move debug cache integrity checks into a new function

2012-08-09 Thread Shuah Khan
On Mon, 2012-08-06 at 15:13 -0600, Shuah Khan wrote: kmem_cache_create() does cache integrity checks when CONFIG_DEBUG_VM is defined. These checks interspersed with the regular code path has lead to compile time warnings when compiled without CONFIG_DEBUG_VM defined. Restructuring the code to

Re: [PATCH v2] mm: Restructure kmem_cache_create() to move debug cache integrity checks into a new function

2012-08-09 Thread Christoph Lameter (Open Source)
On Mon, 6 Aug 2012, Shuah Khan wrote: +#ifdef CONFIG_DEBUG_VM +static int kmem_cache_sanity_check(const char *name, size_t size) Why do we pass size in? AFAICT there is no need to. @@ -53,48 +93,17 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size, size_t align {

Re: [PATCH v2] mm: Restructure kmem_cache_create() to move debug cache integrity checks into a new function

2012-08-09 Thread Shuah Khan
On Thu, 2012-08-09 at 09:13 -0500, Christoph Lameter (Open Source) wrote: On Mon, 6 Aug 2012, Shuah Khan wrote: +#ifdef CONFIG_DEBUG_VM +static int kmem_cache_sanity_check(const char *name, size_t size) Why do we pass size in? AFAICT there is no need to. It is an oversight on my part.

Re: [PATCH v2] mm: Restructure kmem_cache_create() to move debug cache integrity checks into a new function

2012-08-09 Thread Christoph Lameter (Open Source)
On Thu, 9 Aug 2012, Shuah Khan wrote: Moving these checks into kmem_cache_sanity_check() would mean return path handling will change. The first block of sanity checks for name, and size etc. are done before holding the slab_mutex and the second block that checks the slab lists is done after

Re: [PATCH v2] mm: Restructure kmem_cache_create() to move debug cache integrity checks into a new function

2012-08-09 Thread Shuah Khan
On Thu, 2012-08-09 at 14:08 -0500, Christoph Lameter (Open Source) wrote: On Thu, 9 Aug 2012, Shuah Khan wrote: Moving these checks into kmem_cache_sanity_check() would mean return path handling will change. The first block of sanity checks for name, and size etc. are done before holding

[PATCH v2] mm: Restructure kmem_cache_create() to move debug cache integrity checks into a new function

2012-08-06 Thread Shuah Khan
kmem_cache_create() does cache integrity checks when CONFIG_DEBUG_VM is defined. These checks interspersed with the regular code path has lead to compile time warnings when compiled without CONFIG_DEBUG_VM defined. Restructuring the code to move the integrity checks in to a new function would

[PATCH v2] mm: Restructure kmem_cache_create() to move debug cache integrity checks into a new function

2012-08-06 Thread Shuah Khan
kmem_cache_create() does cache integrity checks when CONFIG_DEBUG_VM is defined. These checks interspersed with the regular code path has lead to compile time warnings when compiled without CONFIG_DEBUG_VM defined. Restructuring the code to move the integrity checks in to a new function would