mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "Aleksa Sarai" <cyphar@cyphar.com>,
	lizefan@huawei.com, mingo@redhat.com, richard@nod.at,
	"Frédéric Weisbecker" <fweisbec@gmail.com>,
	linux-kernel@vger.kernel.org, cgroups@vger.kernel.org,
	"Thomas Gleixner" <tglx@linutronix.de>
Subject: Re: [PATCH v12 8/8] cgroup: implement the PIDs subsystem
Date: Thu, 28 May 2015 16:33:12 -0400	[thread overview]
Message-ID: <20150528203312.GA27479@htj.duckdns.org> (raw)
In-Reply-To: <20150519105631.GH19282@twins.programming.kicks-ass.net>

Hello, sorry about the delay.

On Tue, May 19, 2015 at 12:56:31PM +0200, Peter Zijlstra wrote:
> > This has been discussed before. Organisational operations (i.e.
> > attaching to a cgroup) are not to be blocked by a cgroup controller in
> > the unified hierarchy. 
> 
> That's utterly insane. As argued at length in threads like:
> 
>   lkml.kernel.org/r/alpine.DEB.2.11.1505061100040.4225@nanos
> 
> This breaks fundamental control rules and makes life for a number of
> controllers impossible.

I didn't chase that dicussion because it was rather off-topic for
scheduler.

There are several classes of distribution schemes that cgroups deal
with.

A. Ratio-based.  Usually used to distributed resources which are
   replenished over time.  IO time, CPU cycles and so on.  This
   primarily doesn't deal with persistent state.

B. Limiting over-committable resources.  This applies to persistent
   resources like memory but also to transient ones like IO bandwidth
   and iops.  These all operate by limiting how much resources are
   newly given out and thus their neutral state is the overcommitted
   no-limit state.

C. Non-over-committable "hard" resources.  Currently, scheduler RT
   slices are the only one.  These actually should be distributed by
   carving out a finite whole and thus its limits can't be
   over-committed.  They have to behave as allocators rather than
   limiters.

Most persistent resources fall in the B category and we have a very
clear precedences in dealing with configurations of these limits.
Just think about the NPROC ulimit or quota.  They all operate by
suppressing distribution of new resources and allow new limit
configuration to be lower than the current consumption.

There's a clear reason for this.  it allows closing the race window
between configuration change and increasing resource consumption in a
very simple way - lowering the limit and checking the existing usage.

While what Thomas suggested - building a whole new transaction model
on top - can also close the race window.  This breaks from the
convention for no good reason.  It doesn't provide anything beyond
what's what's possible with the established model and it's outright
silly to have NPROC controller to behave so differently from the
existing mechanism which controls exactly the same resource.

> Also, I'll NAK each and every patch that will attempt to remove failing
> can_attach from the cgroup core as it will fundamentally break some
> scheduler controllers.

I was struggling with C above because it was just a single resource
type which belongs to that category but given that cgroups have to
support it ->can_attach() will have to be able to fail for those
resource types, but only for that resource type.

> So please use it, it doesn't make any bloody sense to 'control' the
> number of PIDs but then allow it to overrun the set point.

Again, it's not about ->can_attach() can fail or not in terms of
implementation at all.  It's about following consistent resource
distribution model.  Please don't conflate different resource types.

Thanks.

-- 
tejun

  reply	other threads:[~2015-05-28 20:33 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-18 14:50 [PATCH v12 0/8] cgroup: add pids subsystem Aleksa Sarai
2015-05-18 14:51 ` [PATCH v12 1/8] cgroup: switch to unsigned long for bitmasks Aleksa Sarai
2015-05-18 14:51 ` [PATCH v12 2/8] cgroup: use bitmask to filter for_each_subsys Aleksa Sarai
2015-05-18 14:51 ` [PATCH v12 3/8] cgroup: replace explicit ss_mask checking with for_each_subsys_which Aleksa Sarai
2015-05-18 14:51 ` [PATCH v12 4/8] cgroup, block: implement task_get_css() and use it in bio_associate_current() Aleksa Sarai
2015-05-18 21:59   ` Tejun Heo
2015-05-19  3:05     ` Aleksa Sarai
2015-05-28 20:47       ` Tejun Heo
2015-05-18 14:51 ` [PATCH v12 5/8] cgroup: move enum cgroup_subsys_id definition Aleksa Sarai
2015-05-18 21:59   ` Tejun Heo
2015-05-19  1:25     ` Aleksa Sarai
2015-05-28 20:44       ` Tejun Heo
2015-05-18 14:51 ` [PATCH v12 6/8] cgroup: allow a cgroup subsystem to reject a fork Aleksa Sarai
2015-05-18 22:12   ` Tejun Heo
2015-05-18 14:51 ` [PATCH v12 7/8] cgroup: add a tset_get_css macro Aleksa Sarai
2015-05-18 21:34   ` Tejun Heo
2015-05-19  1:18     ` Aleksa Sarai
2015-05-18 14:51 ` [PATCH v12 8/8] cgroup: implement the PIDs subsystem Aleksa Sarai
2015-05-19  8:00   ` Peter Zijlstra
2015-05-19  8:44     ` Aleksa Sarai
2015-05-19 10:56       ` Peter Zijlstra
2015-05-28 20:33         ` Tejun Heo [this message]
2015-05-19 13:11       ` Thomas Gleixner
2015-05-19 13:43         ` Aleksa Sarai
2015-06-03  2:44           ` Aleksa Sarai
2015-05-28 20:40         ` Tejun Heo
2015-05-30  6:50           ` Aleksa Sarai

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=20150528203312.GA27479@htj.duckdns.org \
    --to=tj@kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=cyphar@cyphar.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=richard@nod.at \
    --cc=tglx@linutronix.de \
    /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®