From: Frank Mayhar <fmayhar@google.com>
To: Petr Tesarik <ptesarik@suse.cz>
Cc: "Björn Steinbrink" <B.Steinbrink@gmx.de>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Oleg Nesterov" <oleg@tv-sign.ru>,
linux-kernel@vger.kernel.org,
"Roland McGrath" <roland@redhat.com>
Subject: Re: CPU POSIX timers livelock
Date: Fri, 02 May 2008 10:10:26 -0700 [thread overview]
Message-ID: <1209748226.13467.6.camel@bobble.smo.corp.google.com> (raw)
In-Reply-To: <1209744785.15210.52.camel@elijah.suse.cz>
On Fri, 2008-05-02 at 18:13 +0200, Petr Tesarik wrote:
> On Fri, 2008-05-02 at 17:21 +0200, Björn Steinbrink wrote:
> > [Added Roland McGrath and Frank Mayhar to Cc:, as this sounds similar
> > enough to what has been discussed here http://lkml.org/lkml/2008/2/6/505]
>
> Yes, I've just now found the thread too, read it, and I think this is
> just another case where the current implementation does not scale.
>
> Was there any followup to the patch posted on the 7th of March? The
> interesting discussion seems to be interrupted there. :(
Roland and I have continued the conversation but we took it off the LKML
since it was really getting into the nitty-gritty details of the
implementation and wasn't that interesting to someone not actually
directly involved.
The upshot is that I have a proposed patch that I have handed to Roland
to review. He's pretty busy, though, so he may not have gotten to it
yet. Perhaps this thread will give him further incentive. :-)
Petr's analysis pretty much matches mine, except that he went into a bit
more detail in actually computing numbers and whatnot whereas I just
reasoned that with a sufficiently large number of threads pretty much
any process that uses POSIX timers can cause the system to livelock,
simply because repeatedly running the thread group list in
run_posix_cpu_timers() will at some point take as long as the timer tick
itself.
My proposed patch that Roland is reviewing corrects the implementation
of run_posix_cpu_timers() to make it run in constant time for a
particular machine by defining a couple of new structures and keeping
the thread group timers in one of these. It's way more complex than
this and I have a README that goes into detail if anyone is interested.
I've tested the patch with as many as 200,000 threads (all of which are
running a prime number sieve and are therefore CPU bound) and it appears
to work fine. Before I post it again, though, I want Roland to sign off
on it.
--
Frank Mayhar <fmayhar@google.com>
Google, Inc.
next prev parent reply other threads:[~2008-05-02 17:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-02 15:05 CPU POSIX timers livelock Petr Tesarik
2008-05-02 15:21 ` Björn Steinbrink
2008-05-02 16:13 ` Petr Tesarik
2008-05-02 16:43 ` Björn Steinbrink
2008-05-02 17:28 ` Oleg Nesterov
2008-05-02 17:10 ` Frank Mayhar [this message]
2008-05-17 0:16 ` CPU POSIX timers livelock (with patch for review) Frank Mayhar
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=1209748226.13467.6.camel@bobble.smo.corp.google.com \
--to=fmayhar@google.com \
--cc=B.Steinbrink@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@tv-sign.ru \
--cc=ptesarik@suse.cz \
--cc=roland@redhat.com \
--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