public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Roman Gushchin <guro@fb.com>
Cc: Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Michal Hocko <mhocko@kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Shakeel Butt <shakeelb@google.com>,
	Vladimir Davydov <vdavydov.dev@gmail.com>
Subject: Re: [PATCH-next] mm, memcg: Add ":deact" tag for reparented kmem caches in memcg_slabinfo
Date: Thu, 27 Jun 2019 14:45:00 -0400	[thread overview]
Message-ID: <cc7a0ac0-6f3a-4d0a-54b2-7387400aeb8c@redhat.com> (raw)
In-Reply-To: <20190626195757.GB24698@tower.DHCP.thefacebook.com>

On 6/26/19 3:58 PM, Roman Gushchin wrote:
> On Fri, Jun 21, 2019 at 01:30:05PM -0400, Waiman Long wrote:
>> With Roman's kmem cache reparent patch, multiple kmem caches of the same
>> type can be seen attached to the same memcg id. All of them, except
>> maybe one, are reparent'ed kmem caches. It can be useful to tag those
>> reparented caches by adding a new slab flag "SLAB_DEACTIVATED" to those
>> kmem caches that will be reparent'ed if it cannot be destroyed completely.
>>
>> For the reparent'ed memcg kmem caches, the tag ":deact" will now be
>> shown in <debugfs>/memcg_slabinfo.
>>
>> Signed-off-by: Waiman Long <longman@redhat.com>
> Hi Waiman!
>
> Sorry for the late reply. The patch overall looks good to me,
> except one nit. Please feel free to use my ack:
> Acked-by: Roman Gushchin <guro@fb.com>
>
>> ---
>>  include/linux/slab.h |  4 ++++
>>  mm/slab.c            |  1 +
>>  mm/slab_common.c     | 14 ++++++++------
>>  mm/slub.c            |  1 +
>>  4 files changed, 14 insertions(+), 6 deletions(-)
>>
>> diff --git a/include/linux/slab.h b/include/linux/slab.h
>> index fecf40b7be69..19ab1380f875 100644
>> --- a/include/linux/slab.h
>> +++ b/include/linux/slab.h
>> @@ -116,6 +116,10 @@
>>  /* Objects are reclaimable */
>>  #define SLAB_RECLAIM_ACCOUNT	((slab_flags_t __force)0x00020000U)
>>  #define SLAB_TEMPORARY		SLAB_RECLAIM_ACCOUNT	/* Objects are short-lived */
>> +
>> +/* Slab deactivation flag */
>> +#define SLAB_DEACTIVATED	((slab_flags_t __force)0x10000000U)
>> +
>>  /*
>>   * ZERO_SIZE_PTR will be returned for zero sized kmalloc requests.
>>   *
>> diff --git a/mm/slab.c b/mm/slab.c
>> index a2e93adf1df0..e8c7743fc283 100644
>> --- a/mm/slab.c
>> +++ b/mm/slab.c
>> @@ -2245,6 +2245,7 @@ int __kmem_cache_shrink(struct kmem_cache *cachep)
>>  #ifdef CONFIG_MEMCG
>>  void __kmemcg_cache_deactivate(struct kmem_cache *cachep)
>>  {
>> +	cachep->flags |= SLAB_DEACTIVATED;
> A nit: it can be done from kmemcg_cache_deactivate() instead,
> and then you don't have to do it in slab and slub separately.
>
> Since it's not slab- or slub-specific code, it'd be better, IMO,
> to put it into slab_common.c.

Thanks for the suggestion.

You are right. It will be cleaner to set the flag in
kmemcg_cache_deactivate(). I have just sent out a v2 patch to do that.

Cheers,
Longman


      reply	other threads:[~2019-06-27 18:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-21 17:30 [PATCH-next] mm, memcg: Add ":deact" tag for reparented kmem caches in memcg_slabinfo Waiman Long
2019-06-22  2:56 ` Shakeel Butt
2019-06-26 19:58 ` Roman Gushchin
2019-06-27 18:45   ` Waiman Long [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cc7a0ac0-6f3a-4d0a-54b2-7387400aeb8c@redhat.com \
    --to=longman@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=guro@fb.com \
    --cc=hannes@cmpxchg.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=shakeelb@google.com \
    --cc=vdavydov.dev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox