xen/locking: harmonize spinlocks and rwlocks regarding preemption
authorJuergen Gross <jgross@suse.com>
Fri, 6 Nov 2020 09:47:09 +0000 (10:47 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 6 Nov 2020 09:47:09 +0000 (10:47 +0100)
commitc3453a23f7905d24f2404787543e26ec7d02301c
treed3b57003a80085e37bab4c0622cb5da5bdf0066e
parent957708c2d1ae25d7375abd5e5e70c3043d64f1f1
xen/locking: harmonize spinlocks and rwlocks regarding preemption

Spinlocks and rwlocks behave differently in the try variants regarding
preemption: rwlocks are switching preemption off before testing the
lock, while spinlocks do so only after the first check.

Modify _spin_trylock() to disable preemption before testing the lock
to be held in order to be preemption-ready.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
xen/common/spinlock.c