Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1287799

Re: [PATCH] mm: memcontrol: MEMCG no longer works with SLOB

From Johannes Weiner <hannes@cmpxchg.org>
Newsgroups linux.kernel
Subject Re: [PATCH] mm: memcontrol: MEMCG no longer works with SLOB
Date 2015-12-09 21:10 +0100
Message-ID <qDTdM-4yA-9@gated-at.bofh.it> (permalink)
References <qDswV-48l-7@gated-at.bofh.it> <qDPWx-2lU-9@gated-at.bofh.it> <qDPWy-2lU-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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?

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 */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/14] mm: memcontrol: account socket memory in unified hierarchy v4-RESEND Johannes Weiner <hannes@cmpxchg.org> - 2015-12-08 16:40 +0100
  [PATCH 01/14] mm: memcontrol: export root_mem_cgroup Johannes Weiner <hannes@cmpxchg.org> - 2015-12-08 16:40 +0100
  [PATCH 06/14] net: tcp_memcontrol: simplify the per-memcg limit access Johannes Weiner <hannes@cmpxchg.org> - 2015-12-08 16:40 +0100
  [PATCH 09/14] mm: memcontrol: generalize the socket accounting jump label Johannes Weiner <hannes@cmpxchg.org> - 2015-12-08 16:40 +0100
  [PATCH 05/14] net: tcp_memcontrol: remove dead per-memcg count of allocated sockets Johannes Weiner <hannes@cmpxchg.org> - 2015-12-08 16:40 +0100
  [PATCH 02/14] net: tcp_memcontrol: properly detect ancestor socket pressure Johannes Weiner <hannes@cmpxchg.org> - 2015-12-08 16:40 +0100
  [PATCH 08/14] net: tcp_memcontrol: simplify linkage between socket and page counter Johannes Weiner <hannes@cmpxchg.org> - 2015-12-08 16:40 +0100
  [PATCH 04/14] net: tcp_memcontrol: protect all tcp_memcontrol calls by jump-label Johannes Weiner <hannes@cmpxchg.org> - 2015-12-08 16:40 +0100
  [PATCH 11/14] mm: memcontrol: move socket code for unified hierarchy accounting Johannes Weiner <hannes@cmpxchg.org> - 2015-12-08 16:40 +0100
  [PATCH 13/14] mm: memcontrol: hook up vmpressure to socket pressure Johannes Weiner <hannes@cmpxchg.org> - 2015-12-08 16:40 +0100
  Re: [PATCH 00/14] mm: memcontrol: account socket memory in unified  hierarchy v4-RESEND David Miller <davem@davemloft.net> - 2015-12-08 17:30 +0100
  [PATCH] mm: memcontrol: only manage socket pressure for CONFIG_INET Arnd Bergmann <arnd@arndb.de> - 2015-12-09 17:40 +0100
    Re: [PATCH] mm: memcontrol: only manage socket pressure for  CONFIG_INET Johannes Weiner <hannes@cmpxchg.org> - 2015-12-09 20:00 +0100
      Re: [PATCH] mm: memcontrol: only manage socket pressure for  CONFIG_INET Andrew Morton <akpm@linux-foundation.org> - 2015-12-09 23:30 +0100
        Re: [PATCH] mm: memcontrol: only manage socket pressure for  CONFIG_INET Johannes Weiner <hannes@cmpxchg.org> - 2015-12-10 00:10 +0100
          Re: [PATCH] mm: memcontrol: only manage socket pressure for  CONFIG_INET Andrew Morton <akpm@linux-foundation.org> - 2015-12-10 00:20 +0100
  [PATCH] mm: memcontrol: MEMCG no longer works with SLOB Arnd Bergmann <arnd@arndb.de> - 2015-12-09 17:40 +0100
    Re: [PATCH] mm: memcontrol: MEMCG no longer works with SLOB Johannes Weiner <hannes@cmpxchg.org> - 2015-12-09 21:10 +0100
      Re: [PATCH] mm: memcontrol: MEMCG no longer works with SLOB Arnd Bergmann <arnd@arndb.de> - 2015-12-09 22:10 +0100
      Re: [PATCH] mm: memcontrol: MEMCG no longer works with SLOB Vladimir Davydov <vdavydov@virtuozzo.com> - 2015-12-10 12:30 +0100
  Re: [PATCH 00/14] mm: memcontrol: account socket memory in unified hierarchy v4-RESEND Arnd Bergmann <arnd@arndb.de> - 2015-12-09 17:40 +0100
    Re: [PATCH 00/14] mm: memcontrol: account socket memory in unified  hierarchy v4-RESEND Johannes Weiner <hannes@cmpxchg.org> - 2015-12-09 19:20 +0100

csiph-web