All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Jonathan Corbet <corbet@lwn.net>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	NeilBrown <neilb@suse.de>, Ingo Molnar <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	lkml <linux-kernel@vger.kernel.org>,
	"Dr. H. Nikolaus Schaller" <hns@goldelico.com>,
	Marek Belisko <marek@goldelico.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: Re: [PATCH/RFC] wait_for_completion_timeout() considered harmful.
Date: Tue, 19 Nov 2013 09:29:13 +0100	[thread overview]
Message-ID: <20131119082913.GE10022@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20131118174902.312d8fa6@lwn.net>

On Mon, Nov 18, 2013 at 05:49:02PM -0700, Jonathan Corbet wrote:
> On Tue, 19 Nov 2013 00:42:09 +0100
> Peter Zijlstra <peterz@infradead.org> wrote:
> 
> > I briefly talked to Thomas about this earlier today and we need to fix
> > this at a lower level -- the quick 'n dirty solution is to add 1 jiffy
> > down in the timer-wheel when we enqueue these things.
> 
> That can lead to situations like the one I encountered years ago where
> msleep(1) would snooze for 20ms. 

No, for up to 20ms, since you get part of the first jiffy, which was the
whole problem (assuming we're talking HZ=100 here).

> I didn't get much love for my idea of
> switching msleep() to hrtimers back then, but I still think it might be be
> better to provide the resolution that the interface appears to promise.

It would actually make more sense to use hrtimers here than it does to
use the old timers since hrtimers has much better gurantees but also
because the timer is guaranteed to fire.

The use case where the old timers really beat hrtimers hands down is
for timeout timers that never actually fire.

  parent reply	other threads:[~2013-11-19  8:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-16 21:06 [PATCH/RFC] wait_for_completion_timeout() considered harmful NeilBrown
2013-11-18 23:27 ` Andrew Morton
2013-11-18 23:42   ` Peter Zijlstra
2013-11-19  0:49     ` Jonathan Corbet
2013-11-19  7:05       ` Ingo Molnar
2013-11-19  8:29       ` Peter Zijlstra [this message]
2013-11-18 23:44   ` NeilBrown
2013-11-19  8:25     ` Peter Zijlstra
2013-11-19  8:58       ` NeilBrown
2013-11-19 12:23         ` Peter Zijlstra
2013-11-19 14:39           ` Thomas Gleixner

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=20131119082913.GE10022@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=corbet@lwn.net \
    --cc=hns@goldelico.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marek@goldelico.com \
    --cc=mingo@redhat.com \
    --cc=neilb@suse.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.