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


Groups > linux.kernel > #1559007

Re: [PATCH 7/9] slab: introduce __kmemcg_cache_deactivate()

From Vladimir Davydov <vdavydov@tarantool.org>
Newsgroups linux.kernel
Subject Re: [PATCH 7/9] slab: introduce __kmemcg_cache_deactivate()
Date 2017-01-14 14:50 +0100
Message-ID <sZwSu-6zJ-15@gated-at.bofh.it> (permalink)
References <sZpxE-2ag-3@gated-at.bofh.it> <sZpxE-2ag-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, Jan 14, 2017 at 12:54:47AM -0500, Tejun Heo wrote:
> __kmem_cache_shrink() is called with %true @deactivate only for memcg
> caches.  Remove @deactivate from __kmem_cache_shrink() and introduce
> __kmemcg_cache_deactivate() instead.  Each memcg-supporting allocator
> should implement it and it should deactivate and drain the cache.
> 
> This is to allow memcg cache deactivation behavior to further deviate
> from simple shrinking without messing up __kmem_cache_shrink().
> 
> This is pure reorganization and doesn't introduce any observable
> behavior changes.
> 
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
> Cc: Christoph Lameter <cl@linux.com>
> Cc: Pekka Enberg <penberg@kernel.org>
> Cc: David Rientjes <rientjes@google.com>
> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>

Acked-by: Vladimir Davydov <vdavydov.dev@gmail.com>

...
> diff --git a/mm/slab.h b/mm/slab.h
> index 8f47a44..73ed6b5 100644
> --- a/mm/slab.h
> +++ b/mm/slab.h
> @@ -164,7 +164,10 @@ static inline unsigned long kmem_cache_flags(unsigned long object_size,
>  
>  int __kmem_cache_shutdown(struct kmem_cache *);
>  void __kmem_cache_release(struct kmem_cache *);
> -int __kmem_cache_shrink(struct kmem_cache *, bool);
> +int __kmem_cache_shrink(struct kmem_cache *);
> +#if defined(CONFIG_MEMCG) && !defined(CONFIG_SLOB)
> +void __kmemcg_cache_deactivate(struct kmem_cache *s);
> +#endif

nit: ifdef is not necessary

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


Thread

[PATCHSET] slab: make memcg slab destruction scalable Tejun Heo <tj@kernel.org> - 2017-01-14 07:00 +0100
  [PATCH 1/9] Revert "slub: move synchronize_sched out of slab_mutex on shrink" Tejun Heo <tj@kernel.org> - 2017-01-14 07:00 +0100
  [PATCH 3/9] slab: simplify shutdown_memcg_caches() Tejun Heo <tj@kernel.org> - 2017-01-14 07:00 +0100
    Re: [PATCH 3/9] slab: simplify shutdown_memcg_caches() Vladimir Davydov <vdavydov@tarantool.org> - 2017-01-14 14:30 +0100
      Re: [PATCH 3/9] slab: simplify shutdown_memcg_caches() Tejun Heo <tj@kernel.org> - 2017-01-14 16:40 +0100
        Re: [PATCH 3/9] slab: simplify shutdown_memcg_caches() Tejun Heo <tj@kernel.org> - 2017-01-14 17:00 +0100
  [PATCH 7/9] slab: introduce __kmemcg_cache_deactivate() Tejun Heo <tj@kernel.org> - 2017-01-14 07:00 +0100
    Re: [PATCH 7/9] slab: introduce __kmemcg_cache_deactivate() Vladimir Davydov <vdavydov@tarantool.org> - 2017-01-14 14:50 +0100
      Re: [PATCH 7/9] slab: introduce __kmemcg_cache_deactivate() Tejun Heo <tj@kernel.org> - 2017-01-14 16:40 +0100

csiph-web