From: Frederic Weisbecker <fweisbec@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Kay Sievers <kay.sievers@vrfy.org>, Tejun Heo <tj@kernel.org>
Cc: linux-kernel@vger.kernel.org, lennart@poettering.net,
harald@redhat.com, david@fubar.dk, greg@kroah.com,
"Kirill A. Shutemov" <kirill@shutemov.name>
Subject: Re: A Plumber’s Wish List for Linux
Date: Wed, 12 Oct 2011 02:59:37 +0200 [thread overview]
Message-ID: <20111012005935.GD14968@somewhere> (raw)
In-Reply-To: <20111011161600.6145aa6b.akpm@linux-foundation.org>
(Resending because I screwed Tejun's email address...)
On Tue, Oct 11, 2011 at 04:16:00PM -0700, Andrew Morton wrote:
> On Fri, 07 Oct 2011 01:17:02 +0200
> Kay Sievers <kay.sievers@vrfy.org> wrote:
> > * fork throttling mechanism as basic cgroup functionality that is
> > available in all hierarchies independent of the controllers used:
> > This is important to implement race-free killing of all members of a
> > cgroup, so that cgroup member processes cannot fork faster then a cgroup
> > supervisor process could kill them. This needs to be recursive, so that
> > not only a cgroup but all its subgroups are covered as well.
>
> Frederic Weisbecker's "cgroups: add a task counter subsystem" should
> address this. Does it meet these requirments? Have you tested it?
It should work for this yeah. We in fact explored and documented that
second usecase of the task counter subsystem for Kay's needs.
Now cgroup subsystems can only be binded in one hierarchy at a time.
So it couldn't be used by Lxc and some other user at the same time
and that defeats kay's goals. But there is an old patch from Paul
Menage that allows some specific subsystems (those that don't deal
with global resources) to be mounted on many hierarchies. The task
counter would fit in and hence be usable by Lxc and other users
simultaneously.
There is another solution that is to be considered. One could use
the cgroup freezer to freeze all the tasks in a cgroup and then kill
them all before thawing the whole. If the process of freezing doesn't
have races against fork then it should work as well. I only worry
about the window in copy_process() between the test on signal_pending(),
that cancels the fork if a signal is pending on the parent, and the
time the new task is eventually added to the cgroup with
cgroup_post_fork(). If the freezer misses the child while it is in that
window, then it's not going to be killed with the rest and it may even
launch some fork() soon to annoy you further. I don't know if that's
handled by the freezer. If it doesn't and that can't be fixed then that
won't work for you.
If the freezer is a possible solution then I don't know which one
is best for you. Perhaps freezing the tasks in the cgroup can make
it faster, or slower, than rejecting any fork and killing directly.
Perhaps it would be helpful to get more details about the practical
case you have.
Anyway, if you think the task counter subsystem approach suits you
better, I can rework Paul's patches that allow multi-bindable
subsystem so that it gets usable by several users simultaneously.
Thanks.
next prev parent reply other threads:[~2011-10-12 0:59 UTC|newest]
Thread overview: 80+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-06 23:17 A Plumber’s Wish List for Linux Kay Sievers
2011-10-06 23:46 ` Andi Kleen
2011-10-07 0:13 ` Lennart Poettering
2011-10-07 1:57 ` Andi Kleen
2011-10-07 15:58 ` Lennart Poettering
2011-10-19 23:16 ` H. Peter Anvin
2011-10-07 7:49 ` Matt Helsley
2011-10-07 16:01 ` Lennart Poettering
2011-10-08 4:24 ` Eric W. Biederman
2011-10-10 16:31 ` Lennart Poettering
2011-10-10 20:59 ` Detecting if you are running in a container Eric W. Biederman
2011-10-10 21:41 ` Lennart Poettering
2011-10-11 5:40 ` Eric W. Biederman
2011-10-11 6:54 ` Eric W. Biederman
2011-10-12 16:59 ` Kay Sievers
2011-11-01 22:05 ` [lxc-devel] " Michael Tokarev
2011-11-01 23:51 ` Eric W. Biederman
2011-11-02 8:08 ` Michael Tokarev
2011-10-11 1:32 ` Ted Ts'o
2011-10-11 2:05 ` Matt Helsley
2011-10-11 3:25 ` Ted Ts'o
2011-10-11 6:42 ` Eric W. Biederman
2011-10-11 12:53 ` Theodore Tso
2011-10-11 21:16 ` Eric W. Biederman
2011-10-11 22:30 ` david
2011-10-12 4:26 ` Eric W. Biederman
2011-10-12 5:10 ` david
2011-10-12 15:08 ` Serge E. Hallyn
2011-10-12 17:57 ` J. Bruce Fields
2011-10-12 18:25 ` Kyle Moffett
2011-10-12 19:04 ` J. Bruce Fields
2011-10-12 19:12 ` Kyle Moffett
2011-10-14 15:54 ` Ted Ts'o
2011-10-14 18:04 ` Eric W. Biederman
2011-10-14 21:58 ` H. Peter Anvin
2011-10-16 9:42 ` Eric W. Biederman
2011-10-30 20:11 ` H. Peter Anvin
2011-11-01 13:38 ` Eric W. Biederman
2011-10-11 22:25 ` david
2011-10-07 10:12 ` A Plumber’s Wish List for Linux Alan Cox
2011-10-07 10:28 ` Kay Sievers
2011-10-07 10:38 ` Alan Cox
2011-10-07 12:46 ` Kay Sievers
2011-10-07 13:39 ` Theodore Tso
2011-10-07 15:21 ` Hugo Mills
2011-10-10 11:18 ` A Plumber???s " David Sterba
2011-10-10 13:09 ` Theodore Tso
2011-10-13 0:28 ` Dave Chinner
2011-10-14 15:47 ` Ted Ts'o
2011-10-11 13:14 ` Serge E. Hallyn
2011-10-11 15:49 ` Andrew G. Morgan
2011-10-12 2:31 ` Serge E. Hallyn
2011-10-12 20:51 ` Lennart Poettering
2011-10-08 9:53 ` A Plumber’s " Bastien ROUCARIES
2011-10-09 3:15 ` Alex Elsayed
2011-10-07 16:07 ` Valdis.Kletnieks
2011-10-07 12:35 ` Vivek Goyal
2011-10-07 18:59 ` Greg KH
2011-10-09 12:20 ` Kay Sievers
2011-10-09 8:45 ` Rusty Russell
2011-10-11 23:16 ` Andrew Morton
2011-10-12 0:53 ` Frederic Weisbecker
2011-10-12 0:59 ` Frederic Weisbecker [this message]
[not found] ` <20111012174014.GE6281@google.com>
2011-10-12 18:16 ` Cyrill Gorcunov
2011-10-14 15:38 ` Frederic Weisbecker
2011-10-14 16:01 ` Cyrill Gorcunov
2011-10-14 16:08 ` Cyrill Gorcunov
2011-10-14 16:19 ` Frederic Weisbecker
2011-10-19 21:19 ` Paul Menage
2011-10-19 21:12 ` Paul Menage
2011-10-19 23:03 ` Lennart Poettering
2011-10-19 23:09 ` Paul Menage
2011-10-19 23:31 ` Lennart Poettering
2011-10-22 10:21 ` Frederic Weisbecker
2011-10-22 15:28 ` Lennart Poettering
2011-10-25 5:40 ` Li Zefan
2011-10-30 17:18 ` Lennart Poettering
2011-11-01 1:27 ` Li Zefan
[not found] <CAE2SPAZci=u__d58phePCftVr_e+i+N2YU-JYjGDG_b3TmYTSQ@mail.gmail.com>
2011-10-07 13:40 ` Alan Cox
2011-10-07 14:57 ` Alexander E. Patrakov
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=20111012005935.GD14968@somewhere \
--to=fweisbec@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=david@fubar.dk \
--cc=greg@kroah.com \
--cc=harald@redhat.com \
--cc=kay.sievers@vrfy.org \
--cc=kirill@shutemov.name \
--cc=lennart@poettering.net \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.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).