[patch 10/29] x86: disable preemption in delay_tsc()

2007-11-20 Thread Greg Kroah-Hartman
2.6.23-stable review patch. If anyone has any objections, please let us know. -- From: Andrew Morton <[EMAIL PROTECTED]> patch 35d5d08a085c56f153458c3f5d8ce24123617faf in mainline. Marin Mitov points out that delay_tsc() can misbehave if it is preempted and rescheduled on a

[patch 10/29] x86: disable preemption in delay_tsc()

2007-11-20 Thread Greg Kroah-Hartman
2.6.23-stable review patch. If anyone has any objections, please let us know. -- From: Andrew Morton [EMAIL PROTECTED] patch 35d5d08a085c56f153458c3f5d8ce24123617faf in mainline. Marin Mitov points out that delay_tsc() can misbehave if it is preempted and rescheduled on a

Re: x86: disable preemption in delay_tsc()

2007-11-16 Thread Ingo Molnar
* Avi Kivity <[EMAIL PROTECTED]> wrote: > You can use preemption notifiers to get a callback when you are > preempted. Not sure what you'd to with that callback, though. but that should not be needed in this case. Why doesnt the TSC using delay loop simply poll the CPU it is on and fix up

Re: x86: disable preemption in delay_tsc()

2007-11-16 Thread Avi Kivity
5c56f153458c3f5d8ce24123617faf Parent: >> 7eea436433b7b18045f272562e256976f593f7c0 Author: Andrew Morton >> <[EMAIL PROTECTED]> AuthorDate: Wed Nov 14 17:00:41 2007 -0800 >> Committer: Linus Torvalds <[EMAIL PROTECTED]> >> CommitDate: Wed Nov 14

Re: x86: disable preemption in delay_tsc()

2007-11-16 Thread Avi Kivity
: 35d5d08a085c56f153458c3f5d8ce24123617faf Parent: 7eea436433b7b18045f272562e256976f593f7c0 Author: Andrew Morton [EMAIL PROTECTED] AuthorDate: Wed Nov 14 17:00:41 2007 -0800 Committer: Linus Torvalds [EMAIL PROTECTED] CommitDate: Wed Nov 14 18:45:44 2007 -0800 x86: disable preemption in delay_tsc

Re: x86: disable preemption in delay_tsc()

2007-11-16 Thread Ingo Molnar
* Avi Kivity [EMAIL PROTECTED] wrote: You can use preemption notifiers to get a callback when you are preempted. Not sure what you'd to with that callback, though. but that should not be needed in this case. Why doesnt the TSC using delay loop simply poll the CPU it is on and fix up the

Re: x86: disable preemption in delay_tsc()

2007-11-15 Thread Andrew Morton
On Fri, 16 Nov 2007 08:17:08 +0100 Ingo Molnar <[EMAIL PROTECTED]> wrote: > > * Andrew Morton <[EMAIL PROTECTED]> 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) { > >

Re: x86: disable preemption in delay_tsc()

2007-11-15 Thread Andrew Morton
On Fri, 16 Nov 2007 07:13:32 +0100 Ingo Molnar <[EMAIL PROTECTED]> wrote: > > * Andrew Morton <[EMAIL PROTECTED]> wrote: > > > > > x86: disable preemption in delay_tsc() > > > > > > > > Marin Mitov points out t

Re: x86: disable preemption in delay_tsc()

2007-11-15 Thread Ingo Molnar
* Andrew Morton <[EMAIL PROTECTED]> 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

Re: x86: disable preemption in delay_tsc()

2007-11-15 Thread Ingo Molnar
* Andrew Morton <[EMAIL PROTECTED]> wrote: > > > 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

Re: x86: disable preemption in delay_tsc()

2007-11-15 Thread Andrew Morton
L PROTECTED]> > > 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. &

Re: x86: disable preemption in delay_tsc()

2007-11-15 Thread Arjan van de Ven
af Parent: > 7eea436433b7b18045f272562e256976f593f7c0 Author: Andrew Morton > <[EMAIL PROTECTED]> AuthorDate: Wed Nov 14 17:00:41 2007 -0800 > Committer: Linus Torvalds <[EMAIL PROTECTED]> > CommitDate: Wed Nov 14 18:45:44 2007 -0800 > > x86: disable preemption in delay_tsc() > >

Re: x86: disable preemption in delay_tsc()

2007-11-15 Thread Andrew Morton
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

Re: x86: disable preemption in delay_tsc()

2007-11-15 Thread Arjan van de Ven
: 7eea436433b7b18045f272562e256976f593f7c0 Author: Andrew Morton [EMAIL PROTECTED] AuthorDate: Wed Nov 14 17:00:41 2007 -0800 Committer: Linus Torvalds [EMAIL PROTECTED] CommitDate: Wed Nov 14 18:45:44 2007 -0800 x86: disable preemption in delay_tsc() Marin Mitov points out

Re: x86: disable preemption in delay_tsc()

2007-11-15 Thread Ingo Molnar
* Andrew Morton [EMAIL PROTECTED] wrote: 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

Re: x86: disable preemption in delay_tsc()

2007-11-15 Thread Ingo Molnar
* Andrew Morton [EMAIL PROTECTED] 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

Re: x86: disable preemption in delay_tsc()

2007-11-15 Thread Andrew Morton
On Fri, 16 Nov 2007 07:13:32 +0100 Ingo Molnar [EMAIL PROTECTED] wrote: * Andrew Morton [EMAIL PROTECTED] wrote: 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

Re: x86: disable preemption in delay_tsc()

2007-11-15 Thread Andrew Morton
On Fri, 16 Nov 2007 08:17:08 +0100 Ingo Molnar [EMAIL PROTECTED] wrote: * Andrew Morton [EMAIL PROTECTED] 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();