From: Andrew Morton <akpm@linux-foundation.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Arjan van de Ven <arjan@infradead.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: x86: disable preemption in delay_tsc()
Date: Thu, 15 Nov 2007 23:26:35 -0800 [thread overview]
Message-ID: <20071115232635.d190acd7.akpm@linux-foundation.org> (raw)
In-Reply-To: <20071116071708.GA2103@elte.hu>
On Fri, 16 Nov 2007 08:17:08 +0100 Ingo Molnar <mingo@elte.hu> wrote:
>
> * Andrew Morton <akpm@linux-foundation.org> wrote:
>
> > It sounds like it would work OK. What is the setup cost for a usleep?
> > I'd have thought that code which does something like
> >
> > while (i++ < 1000) {
> > foo();
> > udelay(1);
> > }
> >
> > would take qiute a bit longer with such a change?
>
> full roundtrip cost ought to be below 10 usecs, depending on the system.
Ow. So the above timeout would take 10x longer. That probably won't break
anything, but quite a few drivers do udelay(1) for post-IO settling times
and they might not like it.
> There's no problem doing a non-preemptible udelay up to 10 usecs and we
> could use usleep above that.
Yup, with a few smarts in there we could work out which is the best to use,
and also compensate for the setup costs.
It doesn't sound very 2.6.24ish though.
As a quicky things perhaps we could only do the preempt_disable()/preempt_enable()
if the TSCs are unsynced? Do we reliably know that? I guess not..
next prev parent reply other threads:[~2007-11-16 7:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200711150400.lAF40lIr020160@hera.kernel.org>
2007-11-16 3:41 ` x86: disable preemption in delay_tsc() Arjan van de Ven
2007-11-16 3:52 ` Andrew Morton
2007-11-16 6:13 ` Ingo Molnar
2007-11-16 7:08 ` Andrew Morton
2007-11-16 7:17 ` Ingo Molnar
2007-11-16 7:26 ` Andrew Morton [this message]
2007-11-16 8:08 ` Avi Kivity
2007-11-16 8:36 ` Ingo Molnar
2007-11-16 8:47 ` [patch] x86: make delay_tsc() preemptible again Ingo Molnar
2007-11-16 9:39 ` Peter Zijlstra
2007-11-16 10:50 ` Ingo Molnar
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=20071115232635.d190acd7.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=arjan@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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