]> xenbits.xensource.com Git - xen.git/commit
xen: Introduce vcpu_sleep_nosync_locked()
authorGeorge Dunlap <george.dunlap@citrix.com>
Wed, 2 May 2018 10:09:18 +0000 (11:09 +0100)
committerGeorge Dunlap <george.dunlap@citrix.com>
Thu, 3 May 2018 10:56:36 +0000 (11:56 +0100)
commitda0a5e00de8aa93f2a7482d138dbee9dec2aa5c2
tree1f4238e3a0a43b969d9fe49939185604d2402141
parent47876e320b65ca31dacf887fd3654f59e9c89810
xen: Introduce vcpu_sleep_nosync_locked()

There are a lot of places which release a lock before calling
vcpu_sleep_nosync(), which then just grabs the lock again.  This is
not only a waste of time, but leads to more code duplication (since
you have to copy-and-paste recipes rather than calling a unified
function), which in turn leads to an increased chance of bugs.

Introduce vcpu_sleep_nosync_locked(), which can be called if you
already hold the schedule lock.

Signed-off-by: George Dunlap <george.dunlap@citrix.com>
Reviewed-by: Dario Faggioli <dfaggioli@suse.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/common/schedule.c