xen/sched: let sched_switch_sched() return new lock address
authorJuergen Gross <jgross@suse.com>
Tue, 28 May 2019 10:32:16 +0000 (12:32 +0200)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 12 Jun 2019 11:27:46 +0000 (12:27 +0100)
commit07513e15e6e7e5163bf4f59c747825cce748531c
tree27aaf03f8256811377803b0812437d7107ef00a9
parent608639ffa0a0d6f219e14ba7397ab2cc018b93c9
xen/sched: let sched_switch_sched() return new lock address

Instead of setting the scheduler percpu lock address in each of the
switch_sched instances of the different schedulers do that in
schedule_cpu_switch() which is the single caller of that function.
For that purpose let sched_switch_sched() just return the new lock
address.

This allows to set the new struct scheduler and struct schedule_data
values in the percpu area in schedule_cpu_switch() instead of the
schedulers, too.

It should be noted that in credit2 the lock used to be set while still
holding the global scheduler write lock, which will no longer be true
with the new scheme applied. This is actually no problem as the write
lock is meant to guard the call of init_pdata() which still is true.

While there, turn the full barrier, which was overkill, into an
smp_wmb(), matching with the one implicit in managing to take the
lock.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Dario Faggioli <dfaggioli@suse.com>
xen/common/sched_arinc653.c
xen/common/sched_credit.c
xen/common/sched_credit2.c
xen/common/sched_null.c
xen/common/sched_rt.c
xen/common/schedule.c
xen/include/xen/sched-if.h