2013-07-10 02:57:08

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build failure after merge of the slab tree

Hi all,

After merging the slab tree, today's linux-next build (x86_64
allmodconfig) failed like this:

In file included from include/linux/slab.h:17:0,
from include/linux/crypto.h:24,
from arch/x86/kernel/asm-offsets.c:8:
include/linux/kmemleak.h: In function 'kmemleak_alloc_recursive':
include/linux/kmemleak.h:44:16: error: 'SLAB_NOLEAKTRACE' undeclared (first use in this function)
if (!(flags & SLAB_NOLEAKTRACE))
^
include/linux/kmemleak.h: In function 'kmemleak_free_recursive':
include/linux/kmemleak.h:50:16: error: 'SLAB_NOLEAKTRACE' undeclared (first use in this function)
if (!(flags & SLAB_NOLEAKTRACE))
^

Probably caused by commit 590a63973e36 ("mm/sl[aou]b: Move kmalloc
definitions to slab.h").

I have used the slab tree from next-20130709 for today.

And, yes, I am a little annoyed by this.
--
Cheers,
Stephen Rothwell [email protected]


Attachments:
(No filename) (951.00 B)
(No filename) (836.00 B)
Download all attachments

2013-07-10 07:01:03

by Pekka Enberg

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the slab tree

On 07/10/2013 05:56 AM, Stephen Rothwell wrote:
> Hi all,
>
> After merging the slab tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
>
> In file included from include/linux/slab.h:17:0,
> from include/linux/crypto.h:24,
> from arch/x86/kernel/asm-offsets.c:8:
> include/linux/kmemleak.h: In function 'kmemleak_alloc_recursive':
> include/linux/kmemleak.h:44:16: error: 'SLAB_NOLEAKTRACE' undeclared (first use in this function)
> if (!(flags & SLAB_NOLEAKTRACE))
> ^
> include/linux/kmemleak.h: In function 'kmemleak_free_recursive':
> include/linux/kmemleak.h:50:16: error: 'SLAB_NOLEAKTRACE' undeclared (first use in this function)
> if (!(flags & SLAB_NOLEAKTRACE))
> ^
>
> Probably caused by commit 590a63973e36 ("mm/sl[aou]b: Move kmalloc
> definitions to slab.h").
>
> I have used the slab tree from next-20130709 for today.
>
> And, yes, I am a little annoyed by this.

Yes, it indeed interacts badly with kmemleak and tracing. I reverted the
commit.

Pekka

Subject: Re: linux-next: build failure after merge of the slab tree

On Wed, 10 Jul 2013, Pekka Enberg wrote:
> Yes, it indeed interacts badly with kmemleak and tracing. I reverted the
> commit.

Here is the fix required. kmemleak.h is weird in that it cannot be
included at the top of slab.h due to its corresponding dependency on
slab.h. Bad situation. kmemleak.h itself should include "slab.h"...

Why not fold kmemleak.h into slab.h to avoid future surprises?



Subject: slabs: kmemleak.h needs to be included after constant definitions.

Kmemleak.h depends on the constant defs in slab.h. It was include before
them. Move the include further down.

Signed-off-by: Christoph Lameter <[email protected]>

Index: linux/include/linux/slab.h
===================================================================
--- linux.orig/include/linux/slab.h 2013-07-10 13:43:36.186641776 -0500
+++ linux/include/linux/slab.h 2013-07-10 13:44:36.735730034 -0500
@@ -14,7 +14,6 @@
#include <linux/gfp.h>
#include <linux/types.h>
#include <linux/workqueue.h>
-#include <linux/kmemleak.h>


/*
@@ -97,6 +96,7 @@
#define ZERO_OR_NULL_PTR(x) ((unsigned long)(x) <= \
(unsigned long)ZERO_SIZE_PTR)

+#include <linux/kmemleak.h>

struct mem_cgroup;
/*

2013-07-11 06:42:40

by Pekka Enberg

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the slab tree

On Wed, 10 Jul 2013, Pekka Enberg wrote:
>> Yes, it indeed interacts badly with kmemleak and tracing. I reverted the
>> commit.

On 07/10/2013 09:48 PM, Christoph Lameter wrote:
> Here is the fix required. kmemleak.h is weird in that it cannot be
> included at the top of slab.h due to its corresponding dependency on
> slab.h. Bad situation. kmemleak.h itself should include "slab.h"...

Can you please resend these after the merge window closes?

Pekka