The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Shawn Bohrer <shawn.bohrer@gmail.com>
To: Arjan van de Ven <arjan@infradead.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: High scheduler wake up times
Date: Sat, 30 Jan 2010 21:47:18 -0600	[thread overview]
Message-ID: <20100131034718.GE27390@mediacenter.gateway.2wire.net> (raw)
In-Reply-To: <20100130164716.230dfe31@infradead.org>

On Sat, Jan 30, 2010 at 04:47:16PM -0800, Arjan van de Ven wrote:
> On Sat, 30 Jan 2010 18:35:49 -0600
> Shawn Bohrer <shawn.bohrer@gmail.com> wrote:
> \
> > 
> > I agree that we are currently depending on a bug in epoll.  The epoll
> > implementation currently rounds up to the next jiffie, so specifying a
> > timeout of 1 ms really just wakes the process up at the next timer
> > tick. I have a patch to fix epoll by converting it to use
> > schedule_hrtimeout_range() that I'll gladly send, but I still need a
> > way to achieve the same thing.
> 
> it's not going to help you; your expectation is incorrect.
> you CANNOT get 1000 iterations per second if you do
> 
> <wait 1 msec>
> <do a bunch of work>
> <wait 1 msec>
> etc in a loop
> 
> the more accurate (read: not rounding down) the implementation, the
> more not-1000 you will get, because to hit 1000 the two actions

Of course that patch makes my situation worse, which was my point.  We
are depending on the _current_ epoll_wait() implementation which calls
schedule_timeout(1).  You do agree that the current epoll_wait()
implementation sleeps less than 1 msec with HZ == 1000 correct?  So as
long as:

work + scheduling_overhead < 1 msec

We _should_ be able to achieve 1000 iterations per second.  I also
realize that with multiple worker processes I need:

(total_work + scheduling_overhead)/number_cpus < 1 msec

With the old kernel I can run 500 of these processes, and I'm hoping
that I'm simply missing the knob I need to tweak to achieve similar
performance on a recent kernel.

Thanks,
Shawn

  reply	other threads:[~2010-01-31  3:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-30 23:45 High scheduler wake up times Shawn Bohrer
2010-01-30 23:56 ` Arjan van de Ven
2010-01-31  0:29   ` Shawn Bohrer
2010-01-31  0:02 ` Arjan van de Ven
2010-01-31  0:11 ` Arjan van de Ven
2010-01-31  0:35   ` Shawn Bohrer
2010-01-31  0:46     ` Shawn Bohrer
2010-01-31  0:47     ` Arjan van de Ven
2010-01-31  3:47       ` Shawn Bohrer [this message]
2010-01-31 18:28         ` Arjan van de Ven
2010-01-31 20:50           ` Shawn Bohrer
2010-02-01  8:51       ` Peter Zijlstra
2010-02-01 19:37         ` Shawn Bohrer

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=20100131034718.GE27390@mediacenter.gateway.2wire.net \
    --to=shawn.bohrer@gmail.com \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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