From patchwork Wed Dec 9 20:01:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Weiner X-Patchwork-Id: 554792 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 6F0031402D6 for ; Thu, 10 Dec 2015 07:01:38 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751325AbbLIUBW (ORCPT ); Wed, 9 Dec 2015 15:01:22 -0500 Received: from gum.cmpxchg.org ([85.214.110.215]:48750 "EHLO gum.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750829AbbLIUBV (ORCPT ); Wed, 9 Dec 2015 15:01:21 -0500 Date: Wed, 9 Dec 2015 15:01:07 -0500 From: Johannes Weiner To: Arnd Bergmann Cc: Andrew Morton , linux-mm@kvack.org, netdev@vger.kernel.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Vladimir Davydov Subject: Re: [PATCH] mm: memcontrol: MEMCG no longer works with SLOB Message-ID: <20151209200107.GA17409@cmpxchg.org> References: <1449588624-9220-1-git-send-email-hannes@cmpxchg.org> <2564892.qO1q7YJ6Nb@wuerfel> <1558902.EBTjGmY9S2@wuerfel> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1558902.EBTjGmY9S2@wuerfel> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Dec 09, 2015 at 05:32:39PM +0100, Arnd Bergmann wrote: > The change to move the kmem accounting into the normal memcg > code means we can no longer use memcg with slob, which lacks > the memcg_params member in its struct kmem_cache: > > ../mm/slab.h: In function 'is_root_cache': > ../mm/slab.h:187:10: error: 'struct kmem_cache' has no member named 'memcg_params' > > This enforces the new dependency in Kconfig. Alternatively, > we could change the slob code to allow using MEMCG. I'm curious, was this a random config or do you actually use CONFIG_SLOB && CONFIG_MEMCG? Excluding CONFIG_MEMCG completely for slob seems harsh, but I would prefer not littering the source with #if defined(CONFIG_MEMCG) && (defined(CONFIG_SLAB) || defined(CONFIG_SLUB)) or #if defined(CONFIG_MEMCG) && !defined(CONFIG_SLOB) for such a special case. The #ifdefs are already out of hand in there. Vladimir, what would you think of simply doing this? --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/mm/slab.h b/mm/slab.h index 5adec08..0b3ec4b 100644 --- a/mm/slab.h +++ b/mm/slab.h @@ -25,6 +25,9 @@ struct kmem_cache { int refcount; /* Use counter */ void (*ctor)(void *); /* Called on object slot creation */ struct list_head list; /* List of all slab caches on the system */ +#ifdef CONFIG_MEMCG + struct memcg_cache_params memcg_params; +#endif }; #endif /* CONFIG_SLOB */