lkml.org 
[lkml]   [2002]   [Jan]   [10]   [last100]   RSS-feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Complete thread (EXPERIMENTAL)
/
DateWed, 9 Jan 2002 22:06:44 -0800 (PST)
FromDavide Libenzi <>
SubjectRe: [PATCH] minor sched-E1 tweaks and questions
Digg This
On Thu, 10 Jan 2002, Rusty Russell wrote:

Another question:

if (likely(prev != next)) {
rq->nr_switches++;
rq->curr = next;
next->cpu = prev->cpu;
context_switch(prev, next);
/*
* The runqueue pointer might be from another CPU
* if the new task was last running on a different
* CPU - thus re-load it.
*/
barrier();
rq = this_rq();
}
spin_unlock_irq(&rq->lock);

I do not understand this comment. How can rq (ie. smp_processor_id()) change? Nothing sleeps here, and if it DID change, the spin_unlock_irq() would be wrong...

If you switch you'll on the stack the rq of the previous cpu spin_unlock_irq(&rq->lock) is fine if you do not switch and if you switch you need to reload rq





- Davide


\
ISP Services
Valid XHTML 1.0!\ /
Valid CSS! Last update: 2005-03-22 12:15    [W:0.158 / U:0.320 seconds]
©2003-2005 Jasper Spaans