(set|rem)runqueue and splhigh

Matthew Dillon dillon at apollo.backplane.com
Wed Dec 31 12:02:02 PST 2003


:Hi !
:
:>     The comment is not correct.  setrunqueue() already enters a critical
:>     section (see the crit_enter() and crit_exit() in setrunqueue()), which
:>     is equivalent to splhigh().  So the following is not needed.
:Ahh, sorry for bothering you. Since the attachment was *very* small
:I didn't ask first, which I would have done otherwise.
:
:So, how about the brackets in vm/vm_glue.c and kern/kern_fork.c
:in swapout/faultin and start_forked_proc respectively ?
:Are they still needed to protect the flags or are they artefacts as well ?
:
:Cheers
:Peter
:
:-- 
:<peter.kadau at xxxxxxxxxxxxxxxx>

    Well, if p_stat is being checked for SRUN in faultin() (for example),
    then that whole thing really needs to be in a critical section.  The
    splhigh() code in there now is not quite sufficient because splhigh()
    does not protect against IPIs.  On the otherhand, the big giant lock
    is still being used pretty much everywhere so the sort of IPI that
    would result in the process state being changed isn't going to occur
    here anyway, which means that splhigh() is, in fact, sufficient for now.

    I think the best thing to do is to leave the code alone for now.  It
    will get cleaned up as a side effect of other work later on.

					-Matt
					Matthew Dillon 
					<dillon at xxxxxxxxxxxxx>





More information about the Submit mailing list