Skip to contentSkip to conversation

xen: RTDS: fix another instance of the 'read NOW()' race

PATCH In review Dario Faggioli 4 participants 4 messages May 24, 2016 – May 26, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: RTDS: fix another instance of the 'read NOW()' race

which was overlooked in 779511f4bf5ae ("sched: avoid races on time values read from NOW()").

---
Cc: Meng Xu <[email protected]>
Cc: George Dunlap <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Wei Liu <[email protected]>

---
 xen/common/sched_rt.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
xen/common/sched_rt.c +3 -1
index 0946101..5b077d7 100644
@@ -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);
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Dario Faggioli

which was overlooked in 779511f4bf5ae ("sched: avoid races on time values read from NOW()").

---
Cc: Meng Xu <[email protected]>
Cc: George Dunlap <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Wei Liu <[email protected]>
---

Signature · 13 lines
Best Regards,

Meng
------------
Meng Xu
PhD Student in Computer and Information Science
University of Pennsylvania
http://www.cis.upenn.edu/~mengxu/

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#2 lore raw
In reply to Dario Faggioli
Quoted 5 lines · Dario Faggioli

which was overlooked in 779511f4bf5ae ("sched: avoid races on time values read from NOW()").

Quoted 20 lines

---
Cc: Meng Xu <[email protected]>
Cc: George Dunlap <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Wei Liu <[email protected]>

---
 xen/common/sched_rt.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
xen/common/sched_rt.c +1 -1
index 0946101..5b077d7 100644
@@ -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;

xen/common/sched_rt.c static void · line 853

Quoted 10 lines
xen/common/sched_rt.c +2 -0
     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);
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Acked-by on v1 1/1
#3 lore raw
In reply to Dario Faggioli
Quoted 5 lines · Dario Faggioli

which was overlooked in 779511f4bf5ae ("sched: avoid races on time values read from NOW()").

Quoted 20 lines

---
Cc: Meng Xu <[email protected]>
Cc: George Dunlap <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Wei Liu <[email protected]>

---
 xen/common/sched_rt.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
xen/common/sched_rt.c +1 -1
index 0946101..5b077d7 100644
@@ -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;

xen/common/sched_rt.c static void · line 853

Quoted 10 lines
xen/common/sched_rt.c +2 -0
     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);
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel