mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Jonathan Corbet <corbet@lwn.net>
Cc: linux-kernel@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH/RFC] msleep() with hrtimers
Date: Mon, 16 Jul 2007 12:48:44 +0200	[thread overview]
Message-ID: <20070716104843.GA31527@elte.hu> (raw)
In-Reply-To: <19044.1184539364@lwn.net>


* Jonathan Corbet <corbet@lwn.net> wrote:

> The OLPC folks and I recently discovered something interesting: on a 
> HZ=100 system, a call to msleep(1) will delay for about 20ms.  The 
> combination of jiffies timekeeping and rounding up means that the 
> minimum delay from msleep will be two jiffies, never less.  That led 
> to multi-second delays in a driver which does a bunch of short 
> msleep() calls and, in response, a change to mdelay(), which will come 
> back in something closer to the requested time.
> 
> Here's another approach: a reimplementation of msleep() and 
> msleep_interruptible() using hrtimers.  On a system without real 
> hrtimers this code will at least drop down to single-jiffy delays much 
> of the time (though not deterministically so).  On my x86_64 system 
> with Thomas's hrtimer/dyntick patch applied, msleep(1) gives almost 
> exactly what was asked for.
> 
> jon
> 
> Use hrtimers for msleep() and msleep_interruptible()
> 
> Signed-off-by: Jonathan Corbet <corbet@lwn.net>

i certainly like this - an msleep() is like mdelay(), so there are real 
delays (and not timeouts) involved, so converting to hrtimers is the 
right thing to do from a conceptual POV too.

Acked-by: Ingo Molnar <mingo@elte.hu>

	Ingo

  parent reply	other threads:[~2007-07-16 10:49 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-15 22:42 Jonathan Corbet
2007-07-15 23:10 ` Arnd Bergmann
2007-07-16 10:48 ` Ingo Molnar [this message]
2007-07-16 11:39 ` Roman Zippel
2007-07-16 11:47   ` Ingo Molnar
2007-07-16 11:54     ` Roman Zippel
2007-07-16 11:57       ` Ingo Molnar
2007-07-16 12:05         ` Roman Zippel
2007-07-16 12:19           ` Ingo Molnar
2007-07-16 13:00             ` Roman Zippel
2007-07-16 14:09               ` Ingo Molnar
2007-07-16 14:32                 ` Roman Zippel
2007-07-16 14:42   ` Jonathan Corbet
2007-07-16 15:18     ` Ingo Molnar
2007-07-16 15:43     ` Roman Zippel
2007-07-16 15:57       ` Ray Lee
2007-07-16 16:08         ` Nish Aravamudan
2007-07-17  4:04           ` Nick Piggin
2007-07-18 17:53             ` Nish Aravamudan
2007-07-16 16:10       ` Ingo Molnar
2007-07-16 16:55         ` Roman Zippel
2007-07-16 17:46       ` Jonathan Corbet
2007-07-20 12:49         ` Roman Zippel
2007-07-16 14:11 ` 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=20070716104843.GA31527@elte.hu \
    --to=mingo@elte.hu \
    --cc=corbet@lwn.net \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®