mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
RTDS: fix another instance of the 'read NOW()' race
which was overlooked in 779511f4bf ("sched: avoid
races on time values read from NOW()").
Reported-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: Meng Xu <mengxu@cis.upenn.edu>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
This commit is contained in:
1 parent
4504b7d1a6
commit
4074e4ebe9
1 file changed
+3
-1
@@ -840,12 +840,14 @@ static void
|
||||
rt_vcpu_insert(const struct scheduler *ops, struct vcpu *vc)
|
||||
{
|
||||
struct rt_vcpu *svc = rt_vcpu(vc);
|
||||
s_time_t now = NOW();
|
||||
s_time_t now;
|
||||
spinlock_t *lock;
|
||||
|
||||
BUG_ON( is_idle_vcpu(vc) );
|
||||
|
||||
lock = vcpu_schedule_lock_irq(vc);
|
||||
|
||||
now = NOW();
|
||||
if ( now >= svc->cur_deadline )
|
||||
rt_update_deadline(now, svc);
|
||||
|
||||
|
||||