• Christoph Hellwig's avatar
    [POWERPC] spufs scheduler: Fix wakeup races · bb5db29a
    Christoph Hellwig authored
    Fix the race between checking for contexts on the runqueue and actually
    waking them in spu_deactive and spu_yield.
    
    The guts of spu_reschedule are split into a new helper called
    grab_runnable_context which shows if there is a runnable thread below
    a specified priority and if yes removes if from the runqueue and uses
    it.  This function is used by the new __spu_deactivate hepler shared
    by preemption and spu_yield to grab a new context before deactivating
    a specified priority and if yes removes if from the runqueue and uses
    it.  This function is used by the new __spu_deactivate hepler shared
    by preemption and spu_yield to grab a new context before deactivating
    the old one.
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarArnd Bergmann <arnd.bergmann@de.ibm.com>
    Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
    Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
    bb5db29a
sched.c 12.5 KB