linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Vladimir Davydov <vdavydov.dev@gmail.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	cgroups@vger.kernel.org, Michal Hocko <mhocko@kernel.org>,
	kernel-team@fb.com
Subject: Re: [PATCH] slub: make sysfs directories for memcg sub-caches optional
Date: Tue, 7 Feb 2017 12:10:06 -0500	[thread overview]
Message-ID: <20170207171006.GB6164@htj.duckdns.org> (raw)
In-Reply-To: <20170206162213.30f909b5ce4c681e2217fb4f@linux-foundation.org>

Hello, Andrew.

On Mon, Feb 06, 2017 at 04:22:13PM -0800, Andrew Morton wrote:
> >  #ifdef CONFIG_MEMCG
> > -	if (is_root_cache(s)) {
> > +	if (is_root_cache(s) && memcg_sysfs_enabled) {
> 
> This could be turned on and off after bootup but I guess the result
> could be pretty confusing.
> 
> However there would be useful use cases?  The user would normally have
> this disabled but if he wants to do a bit of debugging then turn this
> on, create a memcg, have a poke around then turn the feature off again.

Hmm... maybe.  It's somewhat nasty to do after-the-fact.  You would
have to re-walk all the caches to create and destroy the sysfs
entries.  Given that it's a pretty fringe debug feature, I'm not sure
the added complexity would be justified.

> >  		s->memcg_kset = kset_create_and_add("cgroup", NULL, &s->kobj);
> >  		if (!s->memcg_kset) {
> >  			err = -ENOMEM;
> > @@ -5673,7 +5695,8 @@ static void sysfs_slab_remove(struct kme
> >  		return;
> >  
> >  #ifdef CONFIG_MEMCG
> > -	kset_unregister(s->memcg_kset);
> > +	if (s->memcg_kset)
> > +		kset_unregister(s->memcg_kset);
> 
> kset_unregister(NULL) is legal
> 
> --- a/mm/slub.c~slub-make-sysfs-directories-for-memcg-sub-caches-optional-fix
> +++ a/mm/slub.c
> @@ -5699,8 +5699,7 @@ static void sysfs_slab_remove(struct kme
>  		return;
>  
>  #ifdef CONFIG_MEMCG
> -	if (s->memcg_kset)
> -		kset_unregister(s->memcg_kset);
> +	kset_unregister(s->memcg_kset);
>  #endif
>  	kobject_uevent(&s->kobj, KOBJ_REMOVE);
>  	kobject_del(&s->kobj);

Ah, of course, looks good to me.

Thanks.

-- 
tejun

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2017-02-07 17:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-04 14:52 Tejun Heo
2017-02-07  0:22 ` Andrew Morton
2017-02-07 17:10   ` Tejun Heo [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=20170207171006.GB6164@htj.duckdns.org \
    --to=tj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=cl@linux.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=kernel-team@fb.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=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