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:
Dario Faggioli authored and Jan Beulich committed 2016-05-25 14:33:57 +02:00
1 parent 4504b7d1a6
commit 4074e4ebe9
1 file changed
+3 -1
+3 -1
View File
@@ -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);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.