[Linux-ia64] Re: O(1) scheduler "complex" macros

From: Pavel Machek <pavel_at_ucw.cz>
Date: 2002-07-12 22:39:15
Hi!

> >  #define task_running(rq, p) \
> > 	((rq)->curr == (p)) && !spin_is_locked(&(p)->switch_lock)
> 
> one more implementational note: the above test is not 'sharp' in the sense
> that on SMP it's only correct (the test has no barriers) if the runqueue
> lock is held. This is true for all the critical task_running() uses in
> sched.c - and the cases that use it outside the runqueue lock are
> optimizations so they dont need an exact test.

I believe this is worth a *big fat* comment.
								Pavel
-- 
Worst form of spam? Adding advertisment signatures ala sourceforge.net.
What goes next? Inserting advertisment *into* email?
Received on Fri Jul 12 07:37:01 2002

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:09 EST