sched/credit: avoid priority boost for capped domains when unpark
authorEslam Elnikety <elnikety@amazon.com>
Fri, 3 May 2019 19:43:49 +0000 (19:43 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 13 May 2019 09:35:38 +0000 (10:35 +0100)
commit5c8c0ae7c45ef45acde29638fa342c2d721ae70a
treeac193147c4619c345acab7c3bc1b6d2c58653804
parent4597226a356f75e8addee02e87b3a5bae21af8ea
sched/credit: avoid priority boost for capped domains when unpark

When unpausing a capped domain, the scheduler currently clears the
CSCHED_FLAG_VCPU_PARKED flag before vcpu_wake(). This, in turn, causes the
vcpu_wake to set CSCHED_PRI_TS_BOOST, resulting in an unfair credit boost. The
comment around the changed lines already states that clearing the flag should
happen AFTER the unpause. This bug was introduced in commit be650750945
"credit1: Use atomic bit operations for the flags structure".

Original patch author credit: Xi Xiong while at Amazon.

Signed-off-by: Eslam Elnikety <elnikety@amazon.com>
Reviewed-by: Leonard Foerster <foersleo@amazon.de>
Reviewed-by: Petre Eftime <epetre@amazon.com>
Acked-by: Dario Faggioli <dfaggioli@suse.com>
xen/common/sched_credit.c