mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Aleksa Sarai <asarai@suse.de>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Li Zefan <lizefan@huawei.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	"Serge E. Hallyn" <serge.hallyn@ubuntu.com>,
	Aditya Kali <adityakali@google.com>,
	Chris Wilson <chris@chris-wilson.co.uk>,
	linux-kernel@vger.kernel.org, cgroups@vger.kernel.org,
	Christian Brauner <cbrauner@suse.de>,
	dev@opencontainers.org
Subject: Re: [PATCH v1 3/3] cgroup: relax common ancestor restriction for direct descendants
Date: Mon, 25 Jul 2016 14:44:53 -0400	[thread overview]
Message-ID: <20160725184453.GF19588@mtj.duckdns.org> (raw)
In-Reply-To: <7e004486-b402-6e01-9893-c8751bcdb316@suse.de>

On Fri, Jul 22, 2016 at 06:24:25PM +1000, Aleksa Sarai wrote:
> > >  It's about the debris left behind if the admin (or someone with
> > > delegated authority) moves the task to a wholly different cgroup.
> > > 
> > > Now we have a cgroup directory in the old cgroup, which the current
> > > task has been removed from, for which the current user has permissions
> > > and could then move the task back to.  Is that the essence of the
> > > problem?
> > 
> > That'd be one side.  The other side is the one moving.  Let's say the
> > system admin thing wants to move all processe from A proper to B.  It
> > would do that by draining processes from A's procs file into B's and
> > even that is multistep and can race.
> 
> Once freezer is ported, wouldn't that allow you to stop the processes so you
> can drain them? I understand your concern with draining, but surely the same
> races occur if you fork? How many times would you need to scan cgroup.procs
> to make sure that you didn't miss anything (and if there's enough processes
> then cgroup.procs reads aren't atomic either).

Sure, draining has to be iterative and in actual use cases freezing
would help but I think you're misunderstanding why I gave the example.
It wasn't meant to be "if you solve this problem case, we're all
good".  It was an illustration of the underlying problems where the
basic interface isn't fit for this sort of complex semantics.  Please
take a step back and look at the larger picture.  The current
interface is silly in many areas but it's still mostly integral and
I'd really like to keep at least that.

If there is a way to do this in a way which is not hacky, we can
definitely look into it.  However, given that the imminent problem is
relatively small, I'm not too sure that there would be a solution of
justifiable size.

Thanks.

-- 
tejun

      reply	other threads:[~2016-07-25 18:44 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-18 16:18 [PATCH v1 0/3] cgroup: allow for unprivileged management Aleksa Sarai
2016-07-18 16:18 ` [PATCH v1 1/3] kernfs: add support for custom per-sb permission hooks Aleksa Sarai
2016-07-18 16:18 ` [PATCH v1 2/3] cgroup: allow for unprivileged subtree management Aleksa Sarai
2016-07-20 15:45   ` Tejun Heo
2016-07-20 22:59     ` Aleksa Sarai
2016-07-18 16:18 ` [PATCH v1 3/3] cgroup: relax common ancestor restriction for direct descendants Aleksa Sarai
2016-07-20 15:51   ` Tejun Heo
2016-07-20 22:58     ` Aleksa Sarai
2016-07-20 23:02       ` Tejun Heo
2016-07-20 23:18         ` Aleksa Sarai
2016-07-20 23:19           ` Tejun Heo
2016-07-21  7:49             ` Aleksa Sarai
2016-07-21 14:33               ` Serge E. Hallyn
2016-07-21 14:37                 ` Aleksa Sarai
2016-07-21 15:01                   ` Tejun Heo
2016-07-21 15:09                   ` Serge E. Hallyn
2016-07-21 14:51                 ` James Bottomley
2016-07-21 14:59                   ` Tejun Heo
2016-07-21 15:07                     ` Aleksa Sarai
2016-07-21 15:04                       ` Tejun Heo
2016-07-21 14:52               ` Tejun Heo
2016-07-21 15:04                 ` James Bottomley
2016-07-21 15:07                   ` Tejun Heo
2016-07-21 15:16                     ` James Bottomley
2016-07-21 15:26                       ` Tejun Heo
2016-07-21 15:34                         ` James Bottomley
2016-07-21 15:50                           ` Tejun Heo
2016-07-21 18:16                             ` James Bottomley
2016-07-21 21:06                               ` Tejun Heo
2016-07-22  8:30                             ` Aleksa Sarai
2016-07-25 18:38                               ` Tejun Heo
2016-07-25 22:54                                 ` Serge E. Hallyn
2016-07-22  8:24                     ` Aleksa Sarai
2016-07-25 18:44                       ` 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=20160725184453.GF19588@mtj.duckdns.org \
    --to=tj@kernel.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=adityakali@google.com \
    --cc=asarai@suse.de \
    --cc=cbrauner@suse.de \
    --cc=cgroups@vger.kernel.org \
    --cc=chris@chris-wilson.co.uk \
    --cc=dev@opencontainers.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=serge.hallyn@ubuntu.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

all inboxes | Powered by JetHome®