public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Andrew Morton <akpm@osdl.org>
Cc: Russell King <rmk+lkml@arm.linux.org.uk>,
	ray-gmail@madrabbit.org, zippel@linux-m68k.org,
	mrmacman_g4@mac.com, tglx@linutronix.de,
	linux-kernel@vger.kernel.org, george@mvista.com,
	johnstul@us.ibm.com
Subject: Re: [patch 00/43] ktimer reworked
Date: Thu, 1 Dec 2005 22:19:33 +0100	[thread overview]
Message-ID: <20051201211933.GA25142@elte.hu> (raw)
In-Reply-To: <20051201122455.4546d1da.akpm@osdl.org>


* Andrew Morton <akpm@osdl.org> wrote:

> The whole concept of separating "timers" from "timeouts" seems a step 
> backward to me.  A large one.  Why was it done, and can it be undone?

i had a very similar opinion when i first talked to Thomas about HRES 
timers a couple of months ago. I told him that the only sane way to add 
HRES timers to the -rt tree is to integrate them into the existing timer 
wheel, and to avoid a duality of APIs. I told him that adding a separate 
HRES implementation is pretty much a 'non-starter'.

then many months of experimentation followed. We (well, Thomas mostly) 
patiently tried a sub-jiffy method, a split-lists method, all sorts of 
ways to merge high-res timers into the timer wheel. We got HRES timers 
work in every such design, but it looked way too ugly and had bad 
performance and latencies - and we wanted upsteam integration.

so after many months we realized that the core issue is that the 
requirements of 'timers' are unmixable with the requirements of 
'timeouts'. See a more detailed analysis at:

  http://lwn.net/Articles/152436/

i'll try to sum it up again very briefly: the timer wheel is a very 
well-optimized data structure geared towards 'timeout' type of use.  But 
it is at the very edge of its 'feature reach', and we found no workable 
way to extend it into the directions we wanted to go. The moment we 
tried to extend it in one direction (e.g. to increase HZ to 1000000 to 
get 1 usec resolution), it started creaking in some other spots.

the only clean solution we found was to totally separate them, and to 
use the natural data structures for both of them: to keep the highly 
scalable timer wheel on the timeout side, and to use the slower but more 
flexible [and deterministic] timer trees on the timer side. [ktimers are 
still very fast - but they cannot possibly be as fast as the single 
list_add() of add_timer()!]. The two usage scenarios (timeouts and 
timers) do not care about each other.

we could merge the two by driving 'timeouts' via ktimers too - but there 
would be some unavoidable overhead to things like the TCP stack. But 
ktimers cannot be merged into timeouts, that's sure.

	Ingo

  reply	other threads:[~2005-12-01 21:19 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-30 23:56 [patch 00/43] ktimer reworked Thomas Gleixner
2005-12-01  0:41 ` Andrew Morton
2005-12-01  2:19   ` Ingo Molnar
2005-12-01  3:32 ` Roman Zippel
2005-12-01  3:57   ` Kyle Moffett
2005-12-01 15:40     ` Roman Zippel
2005-12-01 16:22       ` Ray Lee
2005-12-01 16:51         ` Russell King
2005-12-01 17:44           ` Roman Zippel
2005-12-01 19:08             ` Steven Rostedt
2005-12-01 21:11               ` Roman Zippel
2005-12-01 22:03                 ` Steven Rostedt
2005-12-02  0:29                   ` Roman Zippel
2005-12-02  0:41                     ` Kyle Moffett
2005-12-02  0:58                       ` john stultz
2005-12-02  1:01                       ` Roman Zippel
2005-12-02  1:09                         ` Kyle Moffett
2005-12-02  1:24                           ` Roman Zippel
2005-12-02  1:47                             ` David Lang
2005-12-02 14:43                               ` Roman Zippel
2005-12-02 15:41                                 ` Kyle Moffett
2005-12-07  9:35                                 ` James Bruce
2005-12-07 12:34                                   ` Roman Zippel
2005-12-07 14:15                                     ` Kyle Moffett
2005-12-07 15:03                                       ` Roman Zippel
2005-12-07 14:17                                     ` Steven Rostedt
2005-12-08 15:43                                     ` James Bruce
2005-12-02  2:51                     ` Steven Rostedt
2005-12-04  1:28               ` Andrew James Wade
2005-12-05 19:40                 ` Roman Zippel
2005-12-06  2:46                   ` Andrew James Wade
2005-12-01 20:24           ` Andrew Morton
2005-12-01 21:19             ` Ingo Molnar [this message]
2005-12-01 21:51               ` Andrew Morton
2005-12-01 22:13                 ` Kyle Moffett
2005-12-01 22:15                   ` Christoph Hellwig
2005-12-02  0:02                     ` Thomas Gleixner
2005-12-02  0:36                       ` Kyle Moffett
2005-12-02  1:06                         ` Andrew Morton
2005-12-02 14:42                         ` John Stoffel
2005-12-02  2:21                       ` Steven Rostedt
2005-12-02  0:46                   ` Roman Zippel
2005-12-01 16:52         ` Roman Zippel

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=20051201211933.GA25142@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@osdl.org \
    --cc=george@mvista.com \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mrmacman_g4@mac.com \
    --cc=ray-gmail@madrabbit.org \
    --cc=rmk+lkml@arm.linux.org.uk \
    --cc=tglx@linutronix.de \
    --cc=zippel@linux-m68k.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