public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Zefan Li <lizefan@huawei.com>,
	Mike Galbraith <umgwanakikbuti@gmail.com>,
	Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Cgroups <cgroups@vger.kernel.org>
Subject: Re: [PATCH] sched: Relax a restriction in sched_rt_can_attach()
Date: Tue, 5 May 2015 10:41:04 -0400	[thread overview]
Message-ID: <20150505144104.GS1971@htj.duckdns.org> (raw)
In-Reply-To: <20150504123738.GZ21418@twins.programming.kicks-ass.net>

Hello, Peter.

On Mon, May 04, 2015 at 02:37:38PM +0200, Peter Zijlstra wrote:
> > I just realized we allow removing/adding controllers from/to cgroups
> > while there are tasks in them, which isn't safe unless we eliminate all
> > can_attach callbacks. We've done so for some cgroup subsystems, but
> > there are still a few of them...
> 
> You can't remove can_attach(), we must be able to disallow joining a
> cgroup.
> 
> If that results in you not being able to change the cgroup setup with
> tasks in, so be it -- that seems like a sane restriction anyhow.

This is really an interface policy issue.  For all other controllers,
it's almost trivial to let organizational operations (setting up
hierarchies, moving processes around) overrule controller
configurations.  The main benefit of doing this is that this decouples
organizational operations from resource control.  Users can depend on
the fact that allowed organizational operations won't fail due to
specific controller configuration issues.

This also works well with controllers accepting target configurations
regardless of the current state and enforcing rules to converge to the
configured state instead.  e.g. if you set max memory lower than the
currently used, the config will be accepted and the controller will
keep trying to make the current state converge to the target state.
This is important as rejecting configuration can lead to chasing game
between configuration attempts and run-away resource consumption.

Now, RR slices are the special case here because it's inherently
different from every other resource cgroup is concerned with.  It
simply doesn't fit into the same model that other resources follow.
There are several options we can try.

1. Decouple RR slices from cpu controller.  This would be the best
   route to follow.  RR slices need a hard allocator no matter what we
   do.  There isn't much point in imposing hierarchical structure on
   top of it.

2. Implement special case behavior so that it can follow the same
   model.  e.g. resetting RR scheduling config when the effective cpu
   cgroup changes or carrying the amount of slice being consumed with
   the process being moved.  No matter how this is done, it's gonna be
   a clear compromise as we're forcing this into the model which
   doesn't quite fit it.  That said, given how RR slices are a special
   case to begin with, I think this can be acceptable.

3. Take compromise in the other direction - add exceptions to
   organizational operations but clearly limit the failure modes.  We
   prolly want to structure code in a way to enforce this.

4. If #1 can be done in time but not right now, simply disallow any
   RR/FIFO in !root cgroups on the unified hierarchy for now.

What do you think?

Thanks.

-- 
tejun

  parent reply	other threads:[~2015-05-05 14:41 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-04  0:54 [PATCH] sched: Relax a restriction in sched_rt_can_attach() Zefan Li
     [not found] ` <5546C34C.7050202-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-05-04  3:13   ` Mike Galbraith
     [not found]     ` <1430709236.3129.42.camel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-05-04  4:39       ` Zefan Li
     [not found]         ` <5546F80B.3070802-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-05-04  5:10           ` Mike Galbraith
     [not found]             ` <1430716247.3129.44.camel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-05-04  5:39               ` Mike Galbraith
     [not found]                 ` <1430717964.3129.62.camel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-05-04  9:11                   ` Zefan Li
     [not found]                     ` <554737AE.5040402-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-05-04 12:08                       ` Mike Galbraith
2015-05-04 12:37                       ` Peter Zijlstra
2015-05-04 14:09                         ` Mike Galbraith
     [not found]                           ` <1430748582.3166.16.camel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-05-05  3:46                             ` Zefan Li
     [not found]                               ` <55483CF8.8030908-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-05-05  6:02                                 ` Mike Galbraith
     [not found]                         ` <20150504123738.GZ21418-ndre7Fmf5hadTX5a5knrm8zTDFooKrT+cvkQGrU6aU0@public.gmane.org>
2015-05-05  3:54                           ` Zefan Li
2015-05-05 14:10                             ` Peter Zijlstra
2015-05-05 14:18                               ` Tejun Heo
2015-05-05 15:19                                 ` Peter Zijlstra
2015-05-05 16:31                                   ` Tejun Heo
2015-05-05 19:00                                     ` Peter Zijlstra
     [not found]                                       ` <20150505190057.GR23123-ndre7Fmf5hadTX5a5knrm8zTDFooKrT+cvkQGrU6aU0@public.gmane.org>
2015-05-05 19:06                                         ` Tejun Heo
     [not found]                                           ` <20150505190603.GZ1971-piEFEHQLUPpN0TnZuCh8vA@public.gmane.org>
2015-05-06  8:49                                             ` Peter Zijlstra
2015-05-05 14:41                         ` Tejun Heo [this message]
2015-05-05 15:11                           ` Peter Zijlstra
2015-05-05 16:13                             ` Tejun Heo
2015-05-05 16:50                               ` Peter Zijlstra
2015-05-05 18:29                                 ` Thomas Gleixner
2015-05-05 19:00                                   ` Tejun Heo
2015-05-06  9:12                                     ` Thomas Gleixner
2015-05-05 18:31                                 ` Tejun Heo
2015-05-05 14:09                   ` 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=20150505144104.GS1971@htj.duckdns.org \
    --to=tj@kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=umgwanakikbuti@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