public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Phillips <phillips@arcor.de>
To: Mark Mielke <mark@mark.mielke.cc>, Linux <linux-kernel@vger.kernel.org>
Subject: Re: Whoa... (was: Re: HZ, preferably as small as possible)
Date: Thu, 11 Jul 2002 23:08:01 +0200	[thread overview]
Message-ID: <E17SlAQ-0002W1-00@starship> (raw)
In-Reply-To: <20020711093620.A19422@mark.mielke.cc>

On Thursday 11 July 2002 15:36, Mark Mielke wrote:
> On Wed, Jul 10, 2002 at 04:09:21PM -0600, Cort Dougan wrote:
> > Yes, please do make it a config option.  10x interrupt overhead makes me
> > worry.  It lets users tailor the kernel to their expected load.
> 
> All this talk is getting to me.
> 
> I thought we recently (1 month ago? 2 months ago?) concluded that
> increases in interrupt frequency only affects performance by a very
> small amount, but generates an increase in responsiveness. The only
> real argument against that I have seen, is the 'power conservation'
> argument. The idea was, that the scheduler itself did not execute
> on most interrupts. The clock is updated, and that is about all.
> 
> I can invent a reason as to why throughput increases, from user space.
> The hard drive sends data to the kernel, the kernel handles the
> hardware interrupt, grabs the buffer, and returns control to the
> active process/thread. It may be some time until the process/thread
> that is *reading* the data gets scheduled. Any reduction in the
> average time a process/thread will be scheduled to execute, results in
> increased throughput.

Yes, it's the same reason that -preempt leads, counterintuitively,
to better throughput under parallel loads.  Contrary to popular
wisdom, lower latency and higher throughput are not always mutally
exclusive.

Anyway, 1 ms timer interrupt is still a snail's pace by the
standards of today's processors, it's silly to worry about it.  If
somebody wants a cruder scheduling interval than the raw timer
interrupt, that's child's play, just step the interval down.  The
only slightly challenging thing is do that without restricting
choice of rate for the raw timer and scheduler, respectively.  Here,
a novel application of Bresenham's algorithm (the line drawing
algorithm) works nicely: at each raw interrupt, subtract the period
of the raw interrupt from an accumulator; if the result is less
than zero, add the period of the scheduler to the accumlator and
drop into the scheduler's part of the timer interrupt.

This Bresenham trick works for arbitrary collections of interrupt
rates, all with different periods.  It has the property that,
over time, the total number of invocations at each rate remains
*exactly* correct, and so long as the raw interrupt runs at a
reasonably high rate, displacement isn't that bad either.

-- 
Daniel

  reply	other threads:[~2002-07-11 21:04 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-10 19:59 HZ, preferably as small as possible Grover, Andrew
2002-07-10 21:09 ` george anzinger
2002-07-11  6:03   ` Hannu Savolainen
2002-07-11  7:15     ` george anzinger
2002-07-12  0:36       ` Stevie O
2002-07-12  0:50         ` Thunder from the hill
2002-07-12  0:55           ` Robert Love
2002-07-12  0:58             ` Thunder from the hill
2002-07-12  1:24             ` Alan Cox
2002-07-12  1:37             ` Mark Hahn
2002-07-12  1:09         ` george anzinger
2002-07-12  1:26           ` Roland Dreier
2002-07-12 17:30             ` george anzinger
2002-07-12  1:35           ` Stevie O
2002-07-12  3:01         ` Bernd Eckenfels
2002-07-11 12:54     ` Thunder from the hill
2002-07-11 15:59       ` Martin Dalecki
2002-07-10 21:28 ` Andrew Morton
2002-07-10 21:35   ` Benjamin LaHaise
2002-07-10 21:38     ` Andrew Morton
2002-07-10 21:42       ` Benjamin LaHaise
2002-07-11  2:14         ` CaT
2002-07-11 17:01     ` Martin Dalecki
2002-07-10 22:01   ` Thunder from the hill
2002-07-10 22:09     ` Cort Dougan
2002-07-11 13:36       ` Whoa... (was: Re: HZ, preferably as small as possible) Mark Mielke
2002-07-11 21:08         ` Daniel Phillips [this message]
2002-07-10 22:41     ` HZ, preferably as small as possible Thunder from the hill
2002-07-10 22:47       ` Thunder from the hill
2002-07-10 22:49       ` Eli Carter
2002-07-10 23:05         ` Thunder from the hill
2002-07-10 23:08       ` Dave Mielke
2002-07-10 23:13         ` Thunder from the hill
2002-07-10 23:50     ` J.A. Magallon
2002-07-11  0:28   ` Lincoln Dale
2002-07-11 11:35     ` Kasper Dupont
2002-07-11 12:30       ` Alan Cox
2002-07-11 13:37         ` Kasper Dupont
2002-07-11 15:46           ` Alan Cox
2002-07-11 18:51       ` george anzinger
2002-07-15  5:06 ` Linus Torvalds
2002-07-15 16:26   ` Robert Love
2002-07-15 18:56     ` Linus Torvalds
2002-07-15 19:52       ` mbs
2002-07-15 20:01         ` yodaiken
2002-07-16 11:41   ` Vojtech Pavlik
2002-07-17 19:33   ` Daniel Phillips
2002-07-17 20:31     ` Richard B. Johnson
2002-07-17 20:40       ` Daniel Phillips
2002-07-17 21:02         ` Richard B. Johnson
2002-07-17 21:02       ` Linus Torvalds
2002-07-17 21:16         ` Daniel Phillips
2002-07-18 12:57         ` Richard B. Johnson
2002-07-18 13:25           ` Daniel Phillips
2002-07-18 10:10       ` Kai Henningsen
2002-07-17 20:55     ` Linus Torvalds

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=E17SlAQ-0002W1-00@starship \
    --to=phillips@arcor.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark@mark.mielke.cc \
    /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