linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: mingo@redhat.com, hannes@cmpxchg.org, lizefan@huawei.com,
	cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-team@fb.com
Subject: Re: [PATCH 3/3] sched: Implement interface for cgroup unified hierarchy
Date: Tue, 4 Aug 2015 11:10:17 -0400	[thread overview]
Message-ID: <20150804151017.GD17598@mtj.duckdns.org> (raw)
In-Reply-To: <20150804090711.GL25159@twins.programming.kicks-ass.net>

Hello, Peter.

On Tue, Aug 04, 2015 at 11:07:11AM +0200, Peter Zijlstra wrote:
> What about the unified hierarchy stuff cannot deal with per-task
> controllers?
> 
> _That_ was the biggest problem from what I can remember, and I see no
> proposed resolution for that here.

I've been thinking about it and I'm now convinced that cgroups just is
the wrong interface to require each application to be programming
against.  I wrote this in the CAT thread too but cgroups may be an
okay management / administration interface but is a horrible
programming interface to be used by individual applications.

For things which don't require hierarchy, the obvious thing to do is
implementing a usual syscall-like interface be it a separate syscall,
an prctl command, an ioctl or whatever.  For things which require
building a hierarchy of member threads, the right thing to do is
making it a part of the usual process hierarchy - this is *the*
hierarchy that applications are familiar with and have the facilities
to deal with, so we can, for example, add a clone or unshare flag
which puts the calling threads in a new child group and then let that
use the fore-mentioned syscall-like interface to configure whatever it
wants to configure.  In the long term, this is *way* better than
letting individual applications fumble with cgroup hierarchy
delegation and pseudo filesystem access.

If hierarchical weight and/or bandwidth limiting for thread hierarchy
is absolutely necessary, doing this shouldn't be too difficult and I
suspect it wouldn't be all that different from autogroup.

> > * cpuacct is implictly enabled and disabled by cpu and its information
> >   is reported through "cpu.stat" which now uses microseconds for all
> >   time durations.  All time duration fields now have "_usec" appended
> >   to them for clarity.  While this doesn't solve the double accounting
> >   immediately, once majority of users switch to v2, cpu can directly
> >   account and report the relevant stats and cpuacct can be disabled on
> >   the unified hierarchy.
> > 
> >   Note that cpuacct.usage_percpu is currently not included in
> >   "cpu.stat".  If this information is actually called for, it can be
> >   added later.
> 
> Since you're rev'ing the interface, can't we simply kill the old cpuacct
> and implement the missing pieces in cpu directly ?

Yeah, that's the plan.  For the transitional period however, we'd have
a lot more usages where cpuacct is mounted in a legacy hierarchy so I
didn't want to incur the overhead of duplicate accounting for those
cases and the dependency mechanism is already there making it trivial.

> > * "cpu.cfs_quota_us" and "cpu.cfs_period_us" are replaced by "cpu.max"
> >   which contains both quota and period.
> 
> This is indeed a maximum limit, however
> 
> > * "cpu.rt_runtime_us" and "cpu.rt_period_us" are replaced by
> >   "cpu.rt.max" which contains both runtime and period.
> 
> the RT thing is conceptually more of a minimum guarantee, than a
> maximum, even though the current implementation is both, there are plans
> to allow (controlled) relaxation of the maximum part.

Ah, I see.  Yeah, then it should be cpu.rt.min.  I'll just remove the
file until the relaxation part is determined.

> Also, if you're going to rev the interface, there's more changes we
> should make. I'll have to go dig them out.

Great, please let me know what you have on mind.

Thanks.

-- 
tejun

  reply	other threads:[~2015-08-04 15:10 UTC|newest]

Thread overview: 92+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-03 22:41 [PATCHSET sched,cgroup] sched: Implement interface for cgroup unified hierarchy Tejun Heo
2015-08-03 22:41 ` [PATCH 1/3] cgroup: define controller file conventions Tejun Heo
2015-08-04  8:42   ` Peter Zijlstra
2015-08-04 14:51     ` Tejun Heo
2015-08-04  8:48   ` Peter Zijlstra
2015-08-04 14:53     ` Tejun Heo
2015-08-04 19:31   ` [PATCH v2 " Tejun Heo
2015-08-05  0:39     ` Kamezawa Hiroyuki
2015-08-05  7:47       ` Michal Hocko
2015-08-06  2:30         ` Kamezawa Hiroyuki
2015-08-07 18:17           ` Michal Hocko
2015-08-17 22:04             ` Johannes Weiner
2015-08-17 21:34     ` Johannes Weiner
2015-08-03 22:41 ` [PATCH 2/3] sched: Misc preps for cgroup unified hierarchy interface Tejun Heo
2015-08-03 22:41 ` [PATCH 3/3] sched: Implement interface for cgroup unified hierarchy Tejun Heo
2015-08-04  9:07   ` Peter Zijlstra
2015-08-04 15:10     ` Tejun Heo [this message]
2015-08-05  9:10       ` Peter Zijlstra
2015-08-05 14:31         ` Tejun Heo
2015-08-17 20:35           ` Tejun Heo
     [not found]           ` <CAPM31RJTf0v=2v90kN6-HM9xUGab_k++upO0Ym=irmfO9+BbFw@mail.gmail.com>
2015-08-18  4:03             ` Paul Turner
2015-08-18 20:31               ` Tejun Heo
2015-08-18 23:39                 ` Kamezawa Hiroyuki
2015-08-19 16:23                   ` Tejun Heo
2015-08-19  3:23                 ` Mike Galbraith
2015-08-19 16:41                   ` Tejun Heo
2015-08-20  4:00                     ` Mike Galbraith
2015-08-20  7:52                       ` Tejun Heo
2015-08-20  8:47                         ` Mike Galbraith
2015-08-21 19:26                 ` Paul Turner
2015-08-22 18:29                   ` Tejun Heo
2015-08-24 15:47                     ` Austin S Hemmelgarn
2015-08-24 17:04                       ` Tejun Heo
2015-08-24 19:18                         ` Mike Galbraith
2015-08-24 20:00                         ` Austin S Hemmelgarn
2015-08-24 20:25                           ` Tejun Heo
2015-08-24 21:00                             ` Paul Turner
2015-08-24 21:12                               ` Tejun Heo
2015-08-24 21:15                                 ` Paul Turner
2015-08-24 20:54                         ` Paul Turner
2015-08-24 21:02                           ` Tejun Heo
2015-08-24 21:10                             ` Paul Turner
2015-08-24 21:17                               ` Tejun Heo
2015-08-24 21:19                                 ` Paul Turner
2015-08-24 21:40                                   ` Tejun Heo
2015-08-24 22:03                                     ` Paul Turner
2015-08-24 22:49                                       ` Tejun Heo
2015-08-24 23:15                                         ` Paul Turner
2015-08-25  2:36                                           ` Kamezawa Hiroyuki
2015-08-25 21:13                                             ` Tejun Heo
2015-08-25  9:24                                           ` Ingo Molnar
2015-08-25 10:00                                             ` Peter Zijlstra
2015-08-25 19:18                                           ` Tejun Heo
2015-08-24 20:52                     ` Paul Turner
2015-08-24 21:36                       ` Tejun Heo
2015-08-24 21:58                         ` Paul Turner
2015-08-24 22:19                           ` Tejun Heo
2015-08-24 23:06                             ` Paul Turner
2015-08-25 21:02                               ` Tejun Heo
2015-09-02 17:03                                 ` Tejun Heo
2015-09-09 12:49                                 ` Paul Turner
2015-09-12 14:40                                   ` Tejun Heo
2015-09-17 14:35                                     ` Peter Zijlstra
2015-09-17 14:53                                       ` Tejun Heo
2015-09-17 15:42                                         ` Peter Zijlstra
2015-09-17 15:10                                       ` Peter Zijlstra
2015-09-17 15:52                                         ` Tejun Heo
2015-09-17 15:53                                           ` Peter Zijlstra
2015-09-17 23:29                                     ` Tejun Heo
2015-09-18 11:27                                     ` Paul Turner
2015-10-01 18:46                                       ` Tejun Heo
2015-10-15 11:42                                         ` Paul Turner
2015-10-23 22:21                                           ` Tejun Heo
2015-10-24  4:36                                             ` Mike Galbraith
2015-10-25  2:18                                               ` Tejun Heo
2015-10-25  3:43                                                 ` Mike Galbraith
2015-10-27  3:16                                                   ` Tejun Heo
2015-10-27  5:42                                                     ` Mike Galbraith
2015-10-27  5:46                                                       ` Tejun Heo
2015-10-27  5:56                                                         ` Mike Galbraith
2015-10-27  6:00                                                           ` Tejun Heo
2015-10-27  6:08                                                             ` Mike Galbraith
2015-10-25  3:54                                                 ` Linus Torvalds
2015-10-25  9:33                                                   ` Ingo Molnar
2015-10-25 10:41                                                     ` Theodore Ts'o
2015-10-25 10:47                                                       ` Florian Weimer
2015-10-25 11:58                                                         ` Theodore Ts'o
2015-10-25 13:17                                                           ` Florian Weimer
2015-10-25 13:40                                                             ` Getrandom wrapper Theodore Ts'o
2015-10-26 13:32                                                               ` Florian Weimer
2015-10-26 14:10                                                             ` [PATCH 3/3] sched: Implement interface for cgroup unified hierarchy Peter Zijlstra
2015-08-04 19:32   ` [PATCH v2 " 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=20150804151017.GD17598@mtj.duckdns.org \
    --to=tj@kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.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).