Subject: Re: [PATCH -mmotm] mm: fix kmemcheck.c build errors

From: Andrew Morton <[email-masked]>
Date: Fri, 5 Sep 2014 13:01:02 -0700

On Fri,  5 Sep 2014 16:28:06 +0900 Joonsoo Kim <[email-masked]> wrote:

> mm-slab_common-move-kmem_cache-definition-to-internal-header.patch
> in mmotm makes following build failure.
> 
> ../mm/kmemcheck.c:70:7: error: dereferencing pointer to incomplete type
> ../mm/kmemcheck.c:83:15: error: dereferencing pointer to incomplete type
> ../mm/kmemcheck.c:95:8: error: dereferencing pointer to incomplete type
> ../mm/kmemcheck.c:95:21: error: dereferencing pointer to incomplete type
> 
> ../mm/slab.h: In function 'cache_from_obj':
> ../mm/slab.h:283:2: error: implicit declaration of function
> 'memcg_kmem_enabled' [-Werror=implicit-function-declaration]
> 
> Add header files to fix kmemcheck.c build errors.
> 
> [[email-masked]] move up memcontrol.h header
> to fix build failure if CONFIG_MEMCG_KMEM=y too.

Looking at this line

> Signed-off-by: Randy Dunlap <[email-masked]>

and at this line

> Signed-off-by: Joonsoo Kim <[email-masked]>

I am suspecting that this patch was authored by Randy.  But there was
no From: line at start-of-changelog to communicate this?

> diff --git a/mm/slab.h b/mm/slab.h
> index 13845d0..963a3f8 100644
> --- a/mm/slab.h
> +++ b/mm/slab.h
> @@ -37,6 +37,8 @@ struct kmem_cache {
>  #include <linux/slub_def.h>
>  #endif
>  
> +#include <linux/memcontrol.h>
> +
>  /*
>   * State of the slab allocator.
>   *

It seems a bit wrong to include a fairly high-level memcontol.h into a
fairly low-level slab.h, but I expect it will work.

I can't really see how
mm-slab_common-move-kmem_cache-definition-to-internal-header.patch
caused the breakage.  I don't know how you were triggering this build
failure - please always include such info in the changelogs.