Skip to contentSkip to conversation

Xen RTDS scheduler locking

DISCUSSION Juergen Gross 1 participant 2 messages Oct 20, 2022

lore
Share & tools
lore
#0 lore raw

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

[1]: http://logs.test-lab.xenproject.org/osstest/logs/173488/test-armhf-armhf-xl-rtds/serial-cubietruck-picasso.log

#1 lore raw
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->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.

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 grab prv->lock inside 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

Quoted 1 line

[1]: http://logs.test-lab.xenproject.org/osstest/logs/173488/test-armhf-armhf-xl-rtds/serial-cubietruck-picasso.log