mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ulrich Drepper" <drepper@gmail.com>
To: "Theodore Tso" <tytso@mit.edu>,
	"Ulrich Drepper" <drepper@gmail.com>,
	"Bill Irwin" <bill.irwin@oracle.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Eric Dumazet" <dada1@cosmosbay.com>,
	linux-kernel@vger.kernel.org, wli@holomorphy.com
Subject: Re: per-thread rusage
Date: Tue, 1 May 2007 21:57:25 -0700	[thread overview]
Message-ID: <a36005b50705012157p15eee224o5511e60c4a956bd@mail.gmail.com> (raw)
In-Reply-To: <20070502043100.GI26093@thunk.org>

On 5/1/07, Theodore Tso <tytso@mit.edu> wrote:
> The question is should we use setrlimit() to set the per-thread CPU
> limit, given that we would need some separate interface to set signal
> that should be sent.
>
> Is there any reason why we should have the interface specify whether
> the signal should be directed to a specified process or kernel
> thread-id, perhaps using si_pid field in the siginfo_t to specify
> which thread had exceeded its CPU limit.  Or would this be overkill?

The more I think about it the more complex it gets.  There is a
problem with delivering the signal to the receiving process itself: it
is out of time and cannot perform the cleanup operation anymore.  You
could grant it a grace period but how long should that be?  Some of
the cleanup handlers might take a long time.  If you don't enforce the
CPU limit then it doesn't have to be in the kernel and you might as
well use CLOCK_THREAD_CPUTIME_ID and create a timer.  This should
already work today.  If not it must be fixed.

Delivering the timeout signal to another thread isn't really possible
either since the cleanup code might access thread-local data which
wouldn't work since it's not the canceled thread's data which is
accessed.

I don't have a good answer right now whether enforced CPU limits can
be implemented at all.  But it seems for your purposes a timer with
the CPU clock might be sufficient.


> Do you think this is something that we could get standardized into an
> upcoming Posix/Posix Threads standard?

Regardless of whether a solution can be found, it's too late for the
next revision.  The deadline for new features is long gone by.

  reply	other threads:[~2007-05-02  4:57 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-04 17:29 William Lee Irwin III
2007-04-04 17:48 ` Eric Dumazet
2007-04-04 18:10   ` William Lee Irwin III
2007-04-09 23:53     ` Andrew Morton
2007-04-10  0:42       ` William Lee Irwin III
2007-04-10  0:53         ` Andrew Morton
2007-04-10  1:12           ` William Lee Irwin III
2007-04-10  1:18             ` Andrew Morton
2007-05-01 17:29         ` Bill Irwin
2007-05-01 18:39           ` Ulrich Drepper
2007-05-01 20:24             ` Bill Irwin
2007-05-01 22:10               ` Ulrich Drepper
2007-05-01 22:27                 ` Theodore Tso
2007-05-01 22:34                   ` Bill Irwin
2007-05-01 23:04                     ` Alan Cox
2007-05-01 23:17                       ` Bill Irwin
2007-05-02  5:05                       ` Balbir Singh
2007-05-02  0:17                   ` Ulrich Drepper
2007-05-02  4:31                     ` Theodore Tso
2007-05-02  4:57                       ` Ulrich Drepper [this message]
2007-05-01 22:29                 ` Bill Irwin
2007-04-04 22:36 ` Valdis.Kletnieks
2007-04-05  4:09   ` William Lee Irwin III
2007-04-10 20:10 Oleg Nesterov

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=a36005b50705012157p15eee224o5511e60c4a956bd@mail.gmail.com \
    --to=drepper@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bill.irwin@oracle.com \
    --cc=dada1@cosmosbay.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=wli@holomorphy.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

all inboxes | Powered by JetHome®