[Cbe-oss-dev] [PATCH] spusched: extend list_mutex coverage

Jeremy Kerr jk at ozlabs.org
Wed Jul 23 21:16:48 EST 2008


Christoph,

> In both cases we take list_mutex check for spu->ctx, the unlock it
> <-- race happens here --> then take the state_mutex.

Sure, but:

 * in find_victim() we re-check victim->ctx after taking the  
   victim's state_mutex; and

 * in spusched_tick, we don't have the list_mutex at all, but
   spu_schedule (the only use of 'spu' after we release
   ctx->state_mutex) is safe against the spu being later bound/unbound,
   as it re-checks for spu->ctx with the list_mutex held.

In either case, we don't make any assumptions about spu->ctx being 
stable across an unlock.. as far as I can see. Feel free to correct me 
if I'm wrong here.

Cheers,


Jeremy



More information about the cbe-oss-dev mailing list