From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by kanga.kvack.org (Postfix) with ESMTP id 3104A6B0035 for ; Sun, 31 Aug 2014 19:33:22 -0400 (EDT) Received: by mail-pa0-f43.google.com with SMTP id et14so10775073pad.16 for ; Sun, 31 Aug 2014 16:33:21 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id gp10si10222509pbd.244.2014.08.31.16.33.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 31 Aug 2014 16:33:21 -0700 (PDT) Message-ID: <5403B0B8.8010507@infradead.org> Date: Sun, 31 Aug 2014 16:33:12 -0700 From: Randy Dunlap MIME-Version: 1.0 Subject: [PATCH -mmotm v2] mm: fix kmemcheck.c build errors References: <5400fba1.732YclygYZprDXeI%akpm@linux-foundation.org> <54012D74.7010302@infradead.org> <540335C5.3030905@infradead.org> In-Reply-To: <540335C5.3030905@infradead.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Andrey Ryabinin , Joonsoo Kim Cc: 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 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... Working patch is below. > > Maybe Andrew should just drop that patch and its associated patches. > > >>> #include >>> >>> void kmemcheck_alloc_shadow(struct page *page, int order, gfp_t flags, int node) From: Randy Dunlap Add header files 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 ../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] Signed-off-by: Randy Dunlap --- mm/kmemcheck.c | 1 + mm/slab.h | 2 ++ 2 files changed, 3 insertions(+) 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 "slab.h" #include void kmemcheck_alloc_shadow(struct page *page, int order, gfp_t flags, int node) Index: mmotm-2014-0829-1515/mm/slab.h =================================================================== --- mmotm-2014-0829-1515.orig/mm/slab.h +++ mmotm-2014-0829-1515/mm/slab.h @@ -268,6 +268,8 @@ static inline void memcg_uncharge_slab(s } #endif +#include + static inline struct kmem_cache *cache_from_obj(struct kmem_cache *s, void *x) { struct kmem_cache *cachep; -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org