credit1: Use atomic bit operations for the flags structure
authorGeorge Dunlap <george.dunlap@eu.citrix.com>
Mon, 4 Mar 2013 12:37:39 +0000 (13:37 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 4 Mar 2013 12:37:39 +0000 (13:37 +0100)
commitbe6507509454adf3bb5a50b9406c88504e996d5a
tree22ad57b2c9a4ceccfd4bc9789f6992f95238d30a
parent81881483859fabf918afe6da8e1a679a37479537
credit1: Use atomic bit operations for the flags structure

The flags structure is not protected by locks (or more precisely,
it is protected using an inconsistent set of locks); we therefore need
to make sure that all accesses are atomic-safe.  This is particulary
important in the case of the PARKED flag, which if clobbered while
changing the YIELD bit will leave a vcpu wedged in an offline state.

Using the atomic bitops also requires us to change the size of the "flags"
element.

Spotted-by: Igor Pavlikevich <ipavlikevich@gmail.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
xen/common/sched_credit.c