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-16 Thread Avi Kivity
Arjan van de Ven wrote: > On Thu, 15 Nov 2007 04:00:47 GMT > Linux Kernel Mailing List wrote: > > >> Gitweb: >> http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=35d5d08a085c56f153458c3f5d8ce24123617faf >> Commit: 35d5d08a085c56f153458c3f5d8ce24123617faf Parent

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 that delay_tsc() can misbehave if it is > > > > preempted and rescheduled

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 long

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. > > >

Re: x86: disable preemption in delay_tsc()

2007-11-15 Thread Andrew Morton
On Thu, 15 Nov 2007 19:41:16 -0800 Arjan van de Ven <[EMAIL PROTECTED]> wrote: > On Thu, 15 Nov 2007 04:00:47 GMT > Linux Kernel Mailing List wrote: > > > Gitweb: > > http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=35d5d08a085c56f153458c3f5d8ce24123617faf > > Comm

Re: x86: disable preemption in delay_tsc()

2007-11-15 Thread Arjan van de Ven
On Thu, 15 Nov 2007 04:00:47 GMT Linux Kernel Mailing List wrote: > Gitweb: > http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=35d5d08a085c56f153458c3f5d8ce24123617faf > Commit: 35d5d08a085c56f153458c3f5d8ce24123617faf Parent: > 7eea436433b7b18045f272562e256976f