Skip to contentSkip to conversation

sched_rt: Improved nested virtualization performance

PATCH In review Tianyang Chen 2 participants 2 messages Nov 19, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched_rt: Improved nested virtualization performance

In nested virtualization, choosing the smaller value for the time slice between the MAX_SCHEDULE and the budget will cause high host CPU usage.

---
 xen/common/sched_rt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/common/sched_rt.c +1 -1
index 4372486..9da3f35 100644
@@ -889,7 +889,7 @@ rt_schedule(const struct scheduler *ops, s_time_t now, bool_t tasklet_work_sched
         }
     }
 
-    ret.time = MIN(snext->budget, MAX_SCHEDULE); /* sched quantum */
+    ret.time = MAX_SCHEDULE; /*should be used in nested virtualization*/
     ret.task = snext->vcpu;
 
     /* TRACE */
Signature · 1 line
1.7.9.5
#1 lore raw

2015-11-18 22:50 GMT-05:00 Tianyang Chen <[email protected]>:

Quoted 3 lines

In nested virtualization, choosing the smaller value for the time slice between the MAX_SCHEDULE and the budget will cause high host CPU usage.

Just add one comment:
I also experienced this issue when I develop Xen in a virtual box on MacBook Air.

The root problem is not the returned time slice in rt_schedule(). The root problem is that the CPU speed for Xen in nested virtualization is not constant, which breaks the budget accounting in the RTDS scheduler, which assumes that the RTDS scheduler runs on homogenous CPUs.

I'm not sure if we should always return the MAX_SCHEDULE as the time slice. A VCPU may have a little bit more budget (< 1ms) than it is assigned on native machine if we always return MAX_SCHEDULE.

What do you think, Dario? Do you think the nested virtualization situation is a concern right now?

Quoted 11 lines
---
 xen/common/sched_rt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/common/sched_rt.c +0 -0
index 4372486..9da3f35 100644

xen/common/sched_rt.c rt_schedule(const struct scheduler *ops, s_time_t now, bool_t tasklet_work_sched · line 894

Quoted 7 lines
xen/common/sched_rt.c +1 -1
@@ -889,7 +889,7 @@ rt_schedule(const struct scheduler *ops, s_time_t now, bool_t tasklet_work_sched
         }
     }
 
-    ret.time = MIN(snext->budget, MAX_SCHEDULE); /* sched quantum */
+    ret.time = MAX_SCHEDULE; /*should be used in nested virtualization*/
     ret.task = snext->vcpu;
 

Tianyang,
The comment for this line should not be changed. The new comment should be in the commit message since this is the explanation of the whole patch.

Thanks,

Meng

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