mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kyle Moffett <mrmacman_g4@mac.com>
To: Roman Zippel <zippel@linux-m68k.org>
Cc: David Lang <david.lang@digitalinsight.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	johnstul@us.ibm.com, george@mvista.com, mingo@elte.hu,
	akpm@osdl.org, linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	ray-gmail@madrabbit.org, Russell King <rmk+lkml@arm.linux.org.uk>
Subject: Re: [patch 00/43] ktimer reworked
Date: Fri, 2 Dec 2005 10:41:41 -0500	[thread overview]
Message-ID: <272E18D2-1CB6-4474-85F0-845B6FC2AD9D@mac.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0512021124360.1609@scrub.home>

On Dec 2, 2005, at 09:43:45, Roman Zippel wrote:
> Hi,
>
> On Thu, 1 Dec 2005, David Lang wrote:
>
>> In addition, once you remove the bulk of these uses from the  
>> picture (by
>> makeing them use a new timer type that's optimized for their  
>> useage pattern,
>> the 'unlikly to expire' case) the remainder of the timer users  
>> easily fall
>> into the catagory where the timer is expected to expire, so that  
>> code can
>> accept a performance hit for removing events prior to them going  
>> off that
>> would not be acceptable in a general case version.
>
> [snip timer wheel is efficient for lots of add remove, timer tree  
> is not]
>
> This means timers which run for less than 2^14 jiffies are better  
> off using the timer wheel, unless they require the higher  
> resolution of the new timer system.

PRECISELY!!!  The point is to provide a new and more flexible API,  
either as two different sets of timer manipulation functions (one for  
timer wheel and one for timer tree) or as a single set with multiple  
backends), and migrate old timers to the new system, reclassifying  
them based on the timer needs.  Some timers/timeouts/whatevers don't  
care much about delivery accuracy and could be placed into a much  
smaller and more efficient timer wheel with only quarter-second or  
half-second accuracy, and maybe even coalesced to one-or-two-second  
boundaries without harming functionality, because they are almost  
certainly going to be removed before they run.  This would be a _big_  
help in tickless systems, where we can schedule a bunch of networking  
timers to all be expired simultaneously, keeping caches hot and  
allowing longer sleep times.  Likewise, we would port some to the new  
API such that they just use the same old ordinary timer wheel.  Other  
timers that want highres guarantees would use the highres part of the  
kernel API (either flags in a structure or a separate set of  
functions) and would be added to a slow but very accurate timer tree.

The fact remains that we have two reasonably useful internal timer  
structures; one which is optimized for lots of timers being added and  
removed frequently, which has poor accuracy, and the other which  
doesn't handle a million timers very well, and is poor at adding and  
removing timers but has excellent accuracy.  We should come up with a  
set of recommendations for when to use each interface.  The _best_  
way to explain that to most kernel developers who don't really  
understand the guts of it is:
1) If you need high resolution and you add the timer and let it  
expire normally, use the ktimer/whatever API.
2) If you just want to time-out an operation or fail when something  
doesn't happen, or a timer that doesn't care about accuracy, use the  
ktimeout/whatever2 API.

> So can we please stop this likely/unlikely expiry nonsense? It's  
> great if you want to tell aunt Tillie about kernel hacking, but  
> it's terrible advice to kernel programmers. When it comes to  
> choosing a timer implementation, the delivery is completely and  
> utterly unimportant.

The fact is, we have a _lot_ of timers, a _lot_ of kernel hackers,  
and we need some easy way to tell people which of two subsystems to  
use.  The fact that the likely/unlikely stuff is easy to tell aunt  
Tillie is precisely what makes it useful to tell kernel hackers with  
a half-million other things on their minds.  Hopefully it will be  
easy enough to understand that when they get around to using timers  
for something or another, they'll pick the right API for their task.

Cheers,
Kyle Moffett

  reply	other threads:[~2005-12-02 15:41 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-30 23:56 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 [this message]
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
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=272E18D2-1CB6-4474-85F0-845B6FC2AD9D@mac.com \
    --to=mrmacman_g4@mac.com \
    --cc=akpm@osdl.org \
    --cc=david.lang@digitalinsight.com \
    --cc=george@mvista.com \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=ray-gmail@madrabbit.org \
    --cc=rmk+lkml@arm.linux.org.uk \
    --cc=rostedt@goodmis.org \
    --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

all inboxes | Powered by JetHome®