Skip to contentSkip to conversation

Xen scheduler

DISCUSSION Ky Srinivasan 2 participants 4 messages Jun 17, 2006 – Jun 18, 2006 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

I had sent the following email to Kier and Ian earlier today. I think this issue is important enough to have a wider discussion on this topic.
K. Y

Quoted 1 line
Quoted 1 line
Quoted 1 line

On Fri, Jun 16, 2006 at 3:23 PM, in message

<[email protected]>,

Quoted 3 lines · Ky Srinivasan

Kier,

In trying to narrow down the cause for domu's timeout problems, it

looks

Quoted 1 line

like we have a more serious problem in the xen scheduler. If you have

active

Quoted 1 line

load on dom0, all other domains get severely starved. A simple way to

see

Quoted 1 line

this is to have a process in an infinite loop on dom0 (for best

results have

Quoted 1 line

as many instances of this process running as the number of physical

CPUs on

Quoted 1 line

the box). With this load on dom0, all other domains will get little

or no cpu

Quoted 3 lines

time.

Looking at the sedf code, it looks like the default values do give a

lot of

Quoted 1 line

preference to dom0. What is the implication of setting domu's

scheduling

Quoted 1 line

parameters comparable to what dom0 gets. When I set domu's period and

slice

Quoted 1 line

values to what dom0 has, domu is getting a reasonable share of the

CPU.

Quoted 5 lines

Regards,

K. Y

#2 lore raw

I just applied the following patch to xen-unstable to make SEDF a bit saner. With this I can't get it to hog the CPU 100% like I could before.

-- Keir

# HG changeset patch
# User [email protected]
# Node ID ef8cdd1dc8360e310423a599ff1da76fb111bc96 # Parent b025491f0ba8ccb9e383379d914fb5ed5ca3ab69 [SEDF] Fix SEDF defaults to make domain0 take only a fair equally-weighted share of extratime. Also, hack the short- blocking logic as otherwise domain0 steals all CPU time for several seconds after waking from a long sleep.

xen/common/sched_sedf.c +17 -9
diff -r b025491f0ba8 -r ef8cdd1dc836 xen/common/sched_sedf.c
@@ -360,24 +360,23 @@
         INIT_LIST_HEAD(EXTRAQ(v->processor,EXTRA_UTIL_Q));
     }
        
+    /* Every VCPU gets an equal share of extratime by default. */
+    inf->deadl_abs   = 0;
+    inf->latency     = 0;
+    inf->status      = EXTRA_AWARE | SEDF_ASLEEP;
+    inf->extraweight = 1;
+
     if ( v->domain->domain_id == 0 )
     {
-        /*set dom0 to something useful to boot the machine*/
+        /* Domain0 gets 75% guaranteed (15ms every 20ms). */
         inf->period    = MILLISECS(20);
         inf->slice     = MILLISECS(15);
-        inf->latency   = 0;
-        inf->deadl_abs = 0;
-        inf->status     = EXTRA_AWARE | SEDF_ASLEEP;
     }
     else
     {
-        /*other domains run in best effort mode*/
+        /* Best-effort extratime only. */
         inf->period    = WEIGHT_PERIOD;
         inf->slice     = 0;
-        inf->deadl_abs = 0;
-        inf->latency   = 0;
-        inf->status     = EXTRA_AWARE | SEDF_ASLEEP;
-        inf->extraweight = 1;
     }
 
     inf->period_orig = inf->period; inf->slice_orig = inf->slice;
@@ -609,7 +608,16 @@
         PRINT(3,"Domain %i.%i: Short_block_loss: %"PRIi64"\n", 
               inf->vcpu->domain->domain_id, inf->vcpu->vcpu_id,
               inf->short_block_lost_tot);
+#if 0
+        /*
+         * KAF: If we don't exit short-blocking state at this point
+         * domain0 can steal all CPU for up to 10 seconds before
+         * scheduling settles down (when competing against another
+         * CPU-bound domain). Doing this seems to make things behave
+         * nicely. Noone gets starved by default.
+         */
         if ( inf->short_block_lost_tot <= 0 )
+#endif
         {
             PRINT(4,"Domain %i.%i compensated short block loss!\n",
                   inf->vcpu->domain->domain_id, inf->vcpu->vcpu_id);
Quoted 35 lines · Ky Srinivasan

I had sent the following email to Kier and Ian earlier today. I think this issue is important enough to have a wider discussion on this topic.
K. Y

Quoted 1 line
Quoted 1 line
Quoted 1 line

On Fri, Jun 16, 2006 at 3:23 PM, in message

<[email protected]>,

Quoted 3 lines · Ky Srinivasan

Kier,

In trying to narrow down the cause for domu's timeout problems, it

looks

Quoted 1 line

like we have a more serious problem in the xen scheduler. If you have

active

Quoted 1 line

load on dom0, all other domains get severely starved. A simple way to

see

Quoted 1 line

this is to have a process in an infinite loop on dom0 (for best

results have

Quoted 1 line

as many instances of this process running as the number of physical

CPUs on

Quoted 1 line

the box). With this load on dom0, all other domains will get little

or no cpu

Quoted 3 lines

time.

Looking at the sedf code, it looks like the default values do give a

lot of

Quoted 1 line

preference to dom0. What is the implication of setting domu's

scheduling

Quoted 1 line

parameters comparable to what dom0 gets. When I set domu's period and

slice

Quoted 1 line

values to what dom0 has, domu is getting a reasonable share of the

CPU.

Quoted 3 lines

Regards,

Quoted 8 lines
Quoted 2 lines

K. Y

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

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

#3 lore raw

Kier,

We are currently testing with your patch. Your patch gives dom0 greater than 75% of the CPU. This is fine if dom0 is allowed to run only I/O intensive workloads. Is this an implicit assumption here.

Regards,

K. Y

Quoted 1 line
Quoted 1 line
Quoted 1 line

On Sat, Jun 17, 2006 at 6:42 AM, in message

<[email protected]>, Keir Fraser

Quoted 1 line · <[email protected]> wrote:

I just applied the following patch to xen- unstable to make SEDF a

bit

Quoted 4 lines

saner. With this I can't get it to hog the CPU 100% like I could before.

-- Keir

#4 lore raw
Quoted 3 lines · Ky Srinivasan

We are currently testing with your patch. Your patch gives dom0 greater than 75% of the CPU. This is fine if dom0 is allowed to run only I/O intensive workloads. Is this an implicit assumption here.

Our view has always been that dom0 is primarily a service domain. If that isn't the case then you may want to reduce its guarantee (easily done) but bear in mind that this can have a bad effect on domU I/O performance. Hopefully my patch gives a balance that strongly favours dom0 but not so much that other domains get starved for significant periods.

-- Keir