From: Max Kellermann <mk-xMchvyqCc6DQT0dZR+AlfA@public.gmane.org>
To: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] cgroup_pids: add fork limit
Date: Tue, 10 Nov 2015 18:52:18 +0100 [thread overview]
Message-ID: <20151110175218.GA21737@rabbit.intern.cm-ag> (raw)
In-Reply-To: <20151110172915.GA13740-qYNAdHglDFBN0TnZuCh8vA@public.gmane.org>
On 2015/11/10 18:29, Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> It's not a stateful resource. Of course the resource is controlled in
> terms of bandwidth not absoulte amount consumed.
I'm glad we now agree on the basic facts.
> It's absurd to limit absoulte amount for CPU cycles.
And yet there's an "absurd" feature called RLIMIT_CPU.
It's absurd because it's per-process. Not because the general idea is
absurd. The idea is good, and I wish the "cpu" or "cpuacct"
controller had such a knob. But that's just my opinion.
> The only action possible from there on would be terminating the
> group. If you wanna do that, do so from userspace.
The kernel already has a documented solution: SIGXCPU and SIGKILL
(already implemented for RLIMIT_CPU).
By the way, I'm not saying RLIMIT_CPU solves my problem - not at all!
I was just explaining why your suggestions don't solve my problem.
> The point is that the missing "feature" is really a non-starter. What
> if the process falls into infinite loop on fork failures? It's just a
> silly thing to implement.
Again, you're reverting to useless rhethorical questions to argue why
a feature is silly.
No, the feature is not silly just because it doesn't solve all
problems at once (which is what your rhetorical question implies).
You need other measures to account for endless loops (be it hostile or
out of stupidity). We do have such measures in our kernel fork.
Other kernel resource limits don't solve all corner cases, but they
were merged anyway.
For example, I can limit I/O and network bandwidth, but I can still
easily stall the whole kernel because the NFS client keeps inode
mutexes locked while waiting for the server, stalling the shrinker,
stalling everything else waiting for the shrinker. That is a real
problem for us. But the existence of that problem doesn't make the
net_prio controller bad - it's just one corner case no controller is
currently able to catch. (In this example, the root cause is bad
kernel code, not a frantic userspace process. But I hope you get the
point.)
To solve problems with frantic processes, I need more tools, not lame
excuses. My "fork limit" patch is one tool that has proven to be very
useful. Maybe one day somebody has a better idea to solve my problem,
but what you said does not.
Max
next prev parent reply other threads:[~2015-11-10 17:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-10 14:06 [PATCH] cgroup_pids: add fork limit Max Kellermann
[not found] ` <144716440621.20175.1000688899886388119.stgit-Rjmu19FXx3rR8JxBgnUBv+rzNCUFrscg@public.gmane.org>
2015-11-10 15:12 ` Tejun Heo
2015-11-10 15:37 ` Max Kellermann
[not found] ` <20151110153746.GA20758-Rjmu19FXx3rR8JxBgnUBv+rzNCUFrscg@public.gmane.org>
2015-11-10 15:44 ` Tejun Heo
2015-11-10 17:06 ` Max Kellermann
2015-11-10 17:29 ` Tejun Heo
[not found] ` <20151110172915.GA13740-qYNAdHglDFBN0TnZuCh8vA@public.gmane.org>
2015-11-10 17:52 ` Max Kellermann [this message]
2015-11-10 15:25 ` Aleksa Sarai
2015-11-10 15:58 ` Austin S Hemmelgarn
2015-11-10 16:19 ` Parav Pandit
2015-11-10 19:54 ` Austin S Hemmelgarn
[not found] ` <56424B83.2080504-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-11-15 13:36 ` Aleksa Sarai
[not found] ` <CAOviyag=rHcDZj3MBR3dMbkdaOY=h1FB-78QLM3CZQe2WrrgCQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-11-16 17:02 ` Austin S Hemmelgarn
2015-11-10 16:01 ` Max Kellermann
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=20151110175218.GA21737@rabbit.intern.cm-ag \
--to=mk-xmchvyqcc6dqt0dzr+alfa@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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).