Xen RTDS scheduler locking
Looking at test failures with RTDS scheduler in Xen [1] I think I've found a major issue with locking in the RTDS scheduler:
svc->flags seems to be not protected properly, as different locks are used when doing non-atomic updates: prv->lock (the RTDS global lock), or the per-scheduler-resource scheduling lock.
I'm not sure what would be the best way to fix that. One rather easy way might be to let the scheduling lock pointer point at prv->lock (merging of the two locks), which is easy doable (credit2 is using a similar scheme to make the scheduling lock per-runqueue). I'm not sure whether this wouldn't result in illegal lock nesting (trying to grab prv->lock inside the scheduling lock), though.
Thoughts?
Juergen
Quoted 7 lines · Juergen Gross
Looking at test failures with RTDS scheduler in Xen [1] I think I've found a major issue with locking in the RTDS scheduler:
svc->flagsseems to be not protected properly, as different locks are used when doing non-atomic updates:prv->lock(the RTDS global lock), or the per-scheduler-resource scheduling lock.
Quoted 6 lines
I'm not sure what would be the best way to fix that. One rather easy way might be to let the scheduling lock pointer point at
prv->lock(merging of the two locks), which is easy doable (credit2 is using a similar scheme to make the scheduling lock per-runqueue). I'm not sure whether this wouldn't result in illegal lock nesting (trying to grabprv->lockinside the scheduling lock), though.
Meh, seems this was wrong thinking on my side. RTDS is already switching the scheduling lock to prv->lock.
Sorry for the noise.
Juergen