All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: ctalbott-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	rni-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	fweisbec-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Michal Hocko <mhocko-AlSwsSmVLrQ@public.gmane.org>,
	Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Vivek Goyal <vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH 2/2] cgroup: make css->refcnt clearing on cgroup removal optional
Date: Sun, 01 Apr 2012 10:00:26 +0800	[thread overview]
Message-ID: <4F77B6BA.4070207__36177.4372206584$1333245654$gmane$org@huawei.com> (raw)
In-Reply-To: <20120330223606.GK28934-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>

Tejun Heo wrote:

> Currently, cgroup removal tries to drain all css references.  If there
> are active css references, the removal logic waits and retries
> ->pre_detroy() until either all refs drop to zero or removal is
> cancelled.
> 


I don't like this either.

> This semantics is unusual and adds non-trivial complexity to cgroup
> core and IMHO is fundamentally misguided in that it couples internal
> implementation details (references to internal data structure) with
> externally visible operation (rmdir).  To userland, this is a behavior
> peculiarity which is unnecessary and difficult to expect (css refs is
> otherwise invisible from userland), and, to policy implementations,
> this is an unnecessary restriction (e.g. blkcg wants to hold css refs
> for caching purposes but can't as that becomes visible as rmdir hang).
> 
> Unfortunately, memcg currently depends on ->pre_destroy() retrials and
> cgroup removal vetoing and can't be immmediately switched to the new
> behavior.  This patch introduces the new behavior of not waiting for
> css refs to drain and maintains the old behavior for subsystems which
> have __DEPRECATED_clear_css_refs set.
> 
> Once, memcg is updated, we can drop the code paths for the old
> behavior as proposed in the following patch.  Note that the following
> patch is incorrect in that dput work item is in cgroup and may lose
> some of dputs when multiples css's are released back-to-back, and
> __css_put() triggers check_for_release() when refcnt reaches 0 instead
> of 1; however, it shows what part can be removed.
> 
>   http://thread.gmane.org/gmane.linux.kernel.containers/22559/focus=75251
> 
> Note that, in not-too-distant future, cgroup core will start emitting
> warning messages for subsys which require the old behavior, so please
> get moving.
> 
> Signed-off-by: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>


Both patches look good.

Acked-by: Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>

and I'd like to see code shrink with memcg updates ASAP.

> Cc: Vivek Goyal <vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> Cc: Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
> Cc: Michal Hocko <mhocko-AlSwsSmVLrQ@public.gmane.org>
> Cc: Balbir Singh <bsingharora-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>

  parent reply	other threads:[~2012-04-01  2:00 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-30 22:34 [PATCH 1/2] cgroup: use negative bias on css->refcnt to block css_tryget() Tejun Heo
2012-03-30 22:34 ` Tejun Heo
     [not found] ` <20120330223423.GJ28934-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-03-30 22:36   ` [PATCH 2/2] cgroup: make css->refcnt clearing on cgroup removal optional Tejun Heo
2012-03-30 22:36     ` Tejun Heo
     [not found]     ` <20120330223606.GK28934-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-03-31 21:28       ` Hiroyuki Kamezawa
2012-04-01  2:00       ` Li Zefan [this message]
2012-04-01 19:48       ` Vivek Goyal
2012-04-01 19:48         ` Vivek Goyal
2012-03-31 21:28     ` Hiroyuki Kamezawa
2012-03-31 21:28       ` Hiroyuki Kamezawa
2012-04-01  2:00     ` Li Zefan
2012-04-01  2:00       ` Li Zefan
2012-04-01 18:54       ` Tejun Heo
2012-04-01 18:54         ` Tejun Heo
     [not found]         ` <20120401185430.GA9230-RcKxWJ4Cfj1J2suj2OqeGauc2jM2gXBXkQQo+JxHRPFibQn6LdNjmg@public.gmane.org>
2012-05-16 22:33           ` Sasha Levin
2012-05-16 22:33             ` Sasha Levin
     [not found]             ` <CA+1xoqe5hMuxzCRhMy7J0XchDk2ZnuxOHJKikROk1-ReAzcT6g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-18 17:55               ` Tejun Heo
2012-05-18 17:55                 ` Tejun Heo
2012-05-18 18:28                 ` Sasha Levin
2012-05-18 18:28                   ` Sasha Levin
2012-05-23 22:22                   ` Tejun Heo
2012-05-23 22:22                     ` Tejun Heo
2012-05-24 13:21                     ` Sasha Levin
2012-05-24 13:21                       ` Sasha Levin
2012-05-24 15:41                       ` [PATCH] cgroup: superblock can't be released with active dentries Tejun Heo
2012-05-24 15:41                         ` Tejun Heo
     [not found]                         ` <20120524154139.GA27983-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-05-28  0:18                           ` Li Zefan
2012-05-28  0:18                             ` Li Zefan
     [not found]                       ` <CA+1xoqdbtkC5Ue3s1qZHHJBLcj9a=djFDGny6AJJSV-pdn7mcA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-24 15:41                         ` Tejun Heo
     [not found]                     ` <20120523222242.GD3933-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2012-05-24 13:21                       ` [PATCH 2/2] cgroup: make css->refcnt clearing on cgroup removal optional Sasha Levin
     [not found]                   ` <CA+1xoqfr5aaGbxoX3YKrJHXTjU9fWSbX_xbuEOU=4K7kMay6XQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-23 22:22                     ` Tejun Heo
     [not found]                 ` <20120518175548.GM19388-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-05-18 18:28                   ` Sasha Levin
     [not found]       ` <4F77B6BA.4070207-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2012-04-01 18:54         ` Tejun Heo

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='4F77B6BA.4070207__36177.4372206584$1333245654$gmane$org@huawei.com' \
    --to=lizefan-hv44wf8li93qt0dzr+alfa@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=ctalbott-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=fweisbec-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mhocko-AlSwsSmVLrQ@public.gmane.org \
    --cc=rni-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=vgoyal-H+wXaHxf7aLQT0dZR+AlfA@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.