cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roman Gushchin <guro-b10kYP2dOMg@public.gmane.org>
To: Vasily Averin <vvs-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Michal Hocko <mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Christian Brauner
	<christian.brauner-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>,
	Serge Hallyn <serge-A9i7LUbDfNHQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH] memcg: enable accounting for pids in nested pid namespaces
Date: Thu, 22 Apr 2021 19:30:20 -0700	[thread overview]
Message-ID: <YIIxPAcdd4p4NTxV@carbon> (raw)
In-Reply-To: <38945563-59ad-fb5e-9f7f-eb65ae4bf55e-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>

On Fri, Apr 23, 2021 at 05:09:01AM +0300, Vasily Averin wrote:
> On 4/23/21 4:00 AM, Roman Gushchin wrote:
> > On Thu, Apr 22, 2021 at 08:44:15AM +0300, Vasily Averin wrote:
> >> init_pid_ns.pid_cachep have enabled memcg accounting, though this
> >> setting was disabled for nested pid namespaces.
> >>
> >> Signed-off-by: Vasily Averin <vvs-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
> >> ---
> >>  kernel/pid_namespace.c | 3 ++-
> >>  1 file changed, 2 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c
> >> index 6cd6715..a46a372 100644
> >> --- a/kernel/pid_namespace.c
> >> +++ b/kernel/pid_namespace.c
> >> @@ -51,7 +51,8 @@ static struct kmem_cache *create_pid_cachep(unsigned int level)
> >>  	mutex_lock(&pid_caches_mutex);
> >>  	/* Name collision forces to do allocation under mutex. */
> >>  	if (!*pkc)
> >> -		*pkc = kmem_cache_create(name, len, 0, SLAB_HWCACHE_ALIGN, 0);
> >> +		*pkc = kmem_cache_create(name, len, 0,
> >> +					 SLAB_HWCACHE_ALIGN | SLAB_ACCOUNT, 0);
> >>  	mutex_unlock(&pid_caches_mutex);
> >>  	/* current can fail, but someone else can succeed. */
> >>  	return READ_ONCE(*pkc);
> >> -- 
> >> 1.8.3.1
> >>
> > 
> > It looks good to me! It makes total sense to apply the same rules to the root
> > and non-root levels.
> > 
> > Acked-by: Roman Gushchin <guro-b10kYP2dOMg@public.gmane.org>
> > 
> > Btw, is there any reason why this patch is not included into the series?
> 
> It is a bugfix and I think it should be added to upstream ASAP.

Then it would be really useful to add some details on why it's a bug,
what kind of problems it causes, etc. If it has to be backported to
stable, please, add cc stable/fixes tag.

Thanks!

  parent reply	other threads:[~2021-04-23  2:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22  5:44 [PATCH] memcg: enable accounting for pids in nested pid namespaces Vasily Averin
     [not found] ` <7b777e22-5b0d-7444-343d-92cbfae5f8b4-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
2021-04-23  1:00   ` Roman Gushchin
2021-04-23  2:09     ` Vasily Averin
     [not found]       ` <38945563-59ad-fb5e-9f7f-eb65ae4bf55e-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
2021-04-23  2:30         ` Roman Gushchin [this message]
2021-04-23  2:53           ` Vasily Averin
     [not found]             ` <cd6680e3-edd0-88fa-bb83-b9f2d5a65d5b-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
2021-04-23  7:34               ` Christian Brauner
2021-04-23 16:54   ` Michal Koutný
2021-04-24 11:54   ` [PATCH v2 0/1] " Vasily Averin
2021-04-24 11:54   ` [PATCH v2 1/1] " Vasily Averin
2021-04-26 19:39     ` Shakeel Butt
     [not found]     ` <8b6de616-fd1a-02c6-cbdb-976ecdcfa604-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
2021-07-14  6:31       ` Vasily Averin
2021-07-14  7:43   ` [PATCH] " Christian Brauner

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=YIIxPAcdd4p4NTxV@carbon \
    --to=guro-b10kyp2domg@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=christian.brauner-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org \
    --cc=mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=serge-A9i7LUbDfNHQT0dZR+AlfA@public.gmane.org \
    --cc=vvs-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).