> From: [EMAIL PROTECTED] (Alan Cox)
> > if (current->need_resched != 0 ||
> > ((p = init_task.next_run) != NULL &&
> > (p->processor == smp_processor_id() ||
> > (p->tss.flags & SPARC_FLAG_NEWCHILD) != 0)))
> > schedule();
>
> Given the races in the above have you proved they work out safely. Thats
> the first thing I looked at and why I never looked further at your example
>
> What races? Here is my proof:
> 1) We always dereference a non-NULL pointer.
Ok.
> We'll just read corrupt data and at worst that can happen is that you
> prematurely go into the scheduler or don't when you should have and go
> around the loop one more time.
Which might be one timer tick later since x86 does "hlt" instructions.
The cost of locking is going to exceed that occasionally tick cost. Ok
yes I buy the proof.
> We already do stuff like this, see sys_getppid().
I know.
-
Linux SMP list: FIRST see FAQ at http://www.irisa.fr/prive/mentre/smp-faq/
To Unsubscribe: send "unsubscribe linux-smp" to [EMAIL PROTECTED]