From mboxrd@z Thu Jan 1 00:00:00 1970 From: Randy Dunlap Subject: Re: [PATCH -mmotm v2] mm: fix kmemcheck.c build errors Date: Sun, 31 Aug 2014 17:17:14 -0700 Message-ID: <5403BB0A.8040000@infradead.org> References: <5400fba1.732YclygYZprDXeI%akpm@linux-foundation.org> <54012D74.7010302@infradead.org> <540335C5.3030905@infradead.org> <5403B0B8.8010507@infradead.org> <20140901001312.GA25599@js1304-P5Q-DELUXE> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from casper.infradead.org ([85.118.1.10]:54110 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752285AbaIAARY (ORCPT ); Sun, 31 Aug 2014 20:17:24 -0400 In-Reply-To: <20140901001312.GA25599@js1304-P5Q-DELUXE> Sender: linux-next-owner@vger.kernel.org List-ID: To: Joonsoo Kim Cc: Andrey Ryabinin , Andrew Morton , Christoph Lameter , LKML , "linux-mm@kvack.org" , linux-next@vger.kernel.org, sfr@canb.auug.org.au, mhocko@suse.cz, Pekka Enberg , Vegard Nossum On 08/31/14 17:13, Joonsoo Kim wrote: > On Sun, Aug 31, 2014 at 04:33:12PM -0700, Randy Dunlap wrote: >> On 08/31/14 07:48, Randy Dunlap wrote: >>> On 08/31/14 04:36, Andrey Ryabinin wrote: >>>> 2014-08-30 5:48 GMT+04:00 Randy Dunlap : >>>>> From: Randy Dunlap >>>>> >>>>> Add header file to fix kmemcheck.c build errors: >>>>> >>>>> ../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 >>>>> >>>>> Signed-off-by: Randy Dunlap >>>>> --- >>>>> mm/kmemcheck.c | 1 + >>>>> 1 file changed, 1 insertion(+) >>>>> >>>>> Index: mmotm-2014-0829-1515/mm/kmemcheck.c >>>>> =================================================================== >>>>> --- mmotm-2014-0829-1515.orig/mm/kmemcheck.c >>>>> +++ mmotm-2014-0829-1515/mm/kmemcheck.c >>>>> @@ -2,6 +2,7 @@ >>>>> #include >>>>> #include >>>>> #include >>>>> +#include >>>> >>>> This will work only for CONFIG_SLAB=y. struct kmem_cache definition >>>> was moved to internal header [*], >>>> so you need to include it here: >>>> #include "slab.h" >>>> >>>> [*] http://ozlabs.org/~akpm/mmotm/broken-out/mm-slab_common-move-kmem_cache-definition-to-internal-header.patch >>> >>> Thanks. That makes sense. [testing] mm/kmemcheck.c still has a build error: >>> >>> In file included from ../mm/kmemcheck.c:5:0: >>> ../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] >>> >> >> Naughty header file. It uses something from without >> #including that header file... > > > Hello. > > Indeed... > Thanks for catching this. > >> >> Working patch is below. > > With your patch, build also failed if CONFIG_MEMCG_KMEM=y. > Right fix is something like below. > > Thanks. > > --------->8---------- > diff --git a/mm/kmemcheck.c b/mm/kmemcheck.c > index fd814fd..cab58bb 100644 > --- a/mm/kmemcheck.c > +++ b/mm/kmemcheck.c > @@ -2,6 +2,7 @@ > #include > #include > #include > +#include "slab.h" > #include > > void kmemcheck_alloc_shadow(struct page *page, int order, gfp_t flags, int node) > 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 > #endif > > +#include > + > /* > * State of the slab allocator. > * > -- Um, yeah, looks equivalent to what I sent as v2. Thanks. -- ~Randy