sched: rework and rename vcpu_force_reschedule()
authorJuergen Gross <jgross@suse.com>
Fri, 27 Sep 2019 12:04:29 +0000 (14:04 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 27 Sep 2019 12:04:29 +0000 (14:04 +0200)
commit66c543cc986ad3b0fc0035367d9ce324ab72514e
tree3794af46f853c62a142c6b4671c2a45104f71b40
parent19049f8d796a220b14675a1e8b657279bd293041
sched: rework and rename vcpu_force_reschedule()

vcpu_force_reschedule() is only used for modifying the periodic timer
of a vcpu. Forcing a vcpu to give up the physical cpu for that purpose
is kind of brutal.

So instead of doing the reschedule dance just operate on the timer
directly. By protecting periodic timer modifications against concurrent
timer activation via a per-vcpu lock it is even no longer required to
bother the target vcpu at all for updating its timer.

Even with the additional lock there is not more serialization involved
compared to the current solution, as today's de-scheduling the vcpu is
requiring to take the schedule lock, which has a much higher contention
probability than the new lock.

Rename the function to vcpu_set_periodic_timer() as this now reflects
the functionality.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Dario Faggioli <dfaggioli@suse.com>
xen/arch/x86/pv/shim.c
xen/common/domain.c
xen/common/schedule.c
xen/include/xen/sched.h