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


Groups > linux.kernel > #1328781

Re: [PATCH 3/5] mm: memcontrol: zap memcg_kmem_online helper

From Johannes Weiner <hannes@cmpxchg.org>
Newsgroups linux.kernel
Subject Re: [PATCH 3/5] mm: memcontrol: zap memcg_kmem_online helper
Date 2016-02-08 06:50 +0100
Message-ID <qZMRY-IU-9@gated-at.bofh.it> (permalink)
References <qZBjQ-Sz-9@gated-at.bofh.it> <qZBjR-Sz-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, Feb 07, 2016 at 08:27:33PM +0300, Vladimir Davydov wrote:
> As kmem accounting is now either enabled for all cgroups or disabled
> system-wide, there's no point in having memcg_kmem_online() helper -
> instead one can use memcg_kmem_enabled() and mem_cgroup_online(), as
> shrink_slab() now does.
> 
> There are only two places left where this helper is used -
> __memcg_kmem_charge() and memcg_create_kmem_cache(). The former can only
> be called if memcg_kmem_enabled() returned true. Since the cgroup it
> operates on is online, mem_cgroup_is_root() check will be enough.
> 
> memcg_create_kmem_cache() can't use mem_cgroup_online() helper instead
> of memcg_kmem_online(), because it relies on the fact that in
> memcg_offline_kmem() memcg->kmem_state is changed before
> memcg_deactivate_kmem_caches() is called, but there we can just
> open-code the check.
> 
> Signed-off-by: Vladimir Davydov <vdavydov@virtuozzo.com>

Nice. I like the direct check for the root memcg.

Acked-by: Johannes Weiner <hannes@cmpxchg.org>

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


Thread

[PATCH 0/5] mm: workingset: make shadow node shrinker memcg aware Vladimir Davydov <vdavydov@virtuozzo.com> - 2016-02-07 18:30 +0100
  [PATCH 1/5] mm: memcontrol: enable kmem accounting for all cgroups in the legacy hierarchy Vladimir Davydov <vdavydov@virtuozzo.com> - 2016-02-07 18:30 +0100
    Re: [PATCH 1/5] mm: memcontrol: enable kmem accounting for all  cgroups in the legacy hierarchy Johannes Weiner <hannes@cmpxchg.org> - 2016-02-08 06:50 +0100
  [PATCH 4/5] radix-tree: account radix_tree_node to memory cgroup Vladimir Davydov <vdavydov@virtuozzo.com> - 2016-02-07 18:30 +0100
    Re: [PATCH 4/5] radix-tree: account radix_tree_node to memory cgroup Johannes Weiner <hannes@cmpxchg.org> - 2016-02-08 07:10 +0100
  [PATCH 5/5] mm: workingset: make shadow node shrinker memcg aware Vladimir Davydov <vdavydov@virtuozzo.com> - 2016-02-07 18:30 +0100
    Re: [PATCH 5/5] mm: workingset: make shadow node shrinker memcg aware Johannes Weiner <hannes@cmpxchg.org> - 2016-02-08 07:30 +0100
      Re: [PATCH 5/5] mm: workingset: make shadow node shrinker memcg aware Vladimir Davydov <vdavydov@virtuozzo.com> - 2016-02-08 15:30 +0100
        Re: [PATCH 5/5] mm: workingset: make shadow node shrinker memcg aware Johannes Weiner <hannes@cmpxchg.org> - 2016-02-08 21:50 +0100
  [PATCH 3/5] mm: memcontrol: zap memcg_kmem_online helper Vladimir Davydov <vdavydov@virtuozzo.com> - 2016-02-07 18:30 +0100
    Re: [PATCH 3/5] mm: memcontrol: zap memcg_kmem_online helper Johannes Weiner <hannes@cmpxchg.org> - 2016-02-08 06:50 +0100

csiph-web