All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Arjan van de Ven <arjan@infradead.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, mingo@elte.hu
Subject: Re: x86: disable preemption in delay_tsc()
Date: Thu, 15 Nov 2007 19:52:34 -0800	[thread overview]
Message-ID: <20071115195234.2dc8406d.akpm@linux-foundation.org> (raw)
In-Reply-To: <20071115194116.12c7a0f6@laptopd505.fenrus.org>

On Thu, 15 Nov 2007 19:41:16 -0800 Arjan van de Ven <arjan@infradead.org> wrote:

> On Thu, 15 Nov 2007 04:00:47 GMT
> Linux Kernel Mailing List <linux-kernel@vger.kernel.org> wrote:
> 
> > Gitweb:
> > http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=35d5d08a085c56f153458c3f5d8ce24123617faf
> > Commit:     35d5d08a085c56f153458c3f5d8ce24123617faf Parent:
> > 7eea436433b7b18045f272562e256976f593f7c0 Author:     Andrew Morton
> > <akpm@linux-foundation.org> AuthorDate: Wed Nov 14 17:00:41 2007 -0800
> > Committer:  Linus Torvalds <torvalds@woody.linux-foundation.org>
> > CommitDate: Wed Nov 14 18:45:44 2007 -0800
> > 
> >     x86: disable preemption in delay_tsc()
> >     
> >     Marin Mitov points out that delay_tsc() can misbehave if it is
> > preempted and rescheduled on a different CPU which has a skewed TSC.
> > Fix it by disabling preemption.
> >  
> 
> this worries me.. this appears to effectively disable preemption during
> udelay() and mdelay() loops... which are very obvious latency inducers.
> 
> Now you can argue that if you're preemptible you should have used
> msleep() and co, and I'll totally buy that. 
> 
> 
> Maybe we should just check if we're still on the same cpu or something,
> or have a cheap way to pin a process to a cpu.... but both are longer
> term solutions.
> 

Yes, we can do better.

But this bug can cause very rare failures in probably a large number of
device drivers on a minorty of machines.  Ugly.  So I felt it best to
plug it fast while people think about more sophisticated fixes.


  reply	other threads:[~2007-11-16  3:53 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 [this message]
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
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=20071115195234.2dc8406d.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 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.