[PATCH v5] introduce macro spin_event_timeout()
Timur Tabi
timur at freescale.com
Thu Mar 12 07:45:47 EST 2009
On Wed, Mar 11, 2009 at 2:22 PM, Scott Wood <scottwood at freescale.com> wrote:
> I was under the impression that we were only talking about timeouts, and
> that the common case was significantly shorter than that.
I think one of the concerns that Alan Cox raised is that the existence
of this macro would encourage people to spin for long durations.
> If it's atomic because preemption was disabled, yes -- but even a rare
> extended spin in such a context would be bad for hard realtime. If
> interrupts are disabled, or the code is executing from a timer interrupt (or
> possibly other interrupts depending on the hardware and its priority
> scheme), no.
So in that case, I can't rely on jiffies. I guess get_cycle() is my
only choice. The problem is that there is no num_cycles_per_usec().
--
Timur Tabi
Linux kernel developer at Freescale
More information about the Linuxppc-dev
mailing list