All of lore.kernel.org
 help / color / mirror / Atom feed
From: Emmanuel Ackaouy <ack@xensource.com>
To: Atsushi SAKAI <sakaia@jp.fujitsu.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [Q] about Credit Scheduler Dom0 Scheduling policy.
Date: Wed, 25 Oct 2006 11:29:49 +0100	[thread overview]
Message-ID: <20061025102948.GA32281@cockermouth.uk.xensource.com> (raw)
In-Reply-To: <200610240647.k9O6lYQR004608@fjmscan503.ms.jp.fujitsu.com>

[-- Attachment #1: Type: text/plain, Size: 512 bytes --]

Thanks for sending me the full logs!

I took a look and I do indeed see some cycles during which
dom0 and the I/O generating domU don't preempt the spinners.
I believe this is because those domains don't always consume
enough CPU to appear in the accounting paths.

I have coded up a fix which should make things better for
I/O intensive domains that use few CPU resources. I am
including the patch here. It applies to tip of untable.

Can you try out this patch and let me know how it works?

Thanks,
Emmanuel.

[-- Attachment #2: sched-wake-boost.patch --]
[-- Type: text/plain, Size: 2267 bytes --]

diff -r 0c7923eb6b98 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Wed Oct 25 10:27:03 2006 +0100
+++ b/xen/common/sched_credit.c	Wed Oct 25 11:11:22 2006 +0100
@@ -46,6 +46,7 @@
 /*
  * Priorities
  */
+#define CSCHED_PRI_TS_BOOST      0      /* time-share waking up */
 #define CSCHED_PRI_TS_UNDER     -1      /* time-share w/ credits */
 #define CSCHED_PRI_TS_OVER      -2      /* time-share w/o credits */
 #define CSCHED_PRI_IDLE         -64     /* idle */
@@ -410,6 +411,14 @@ csched_vcpu_acct(struct csched_vcpu *svc
 
         spin_unlock_irqrestore(&csched_priv.lock, flags);
     }
+
+    /*
+     * If this VCPU's priority was boosted when it last awoke, reset it.
+     * If the VCPU is found here, then it's consuming a non-negligeable
+     * amount of CPU resources and should no longer be boosted.
+     */
+    if ( svc->pri == CSCHED_PRI_TS_BOOST )
+        svc->pri = CSCHED_PRI_TS_UNDER;
 }
 
 static inline void
@@ -566,6 +575,25 @@ csched_vcpu_wake(struct vcpu *vc)
     else
         CSCHED_STAT_CRANK(vcpu_wake_not_runnable);
 
+    /*
+     * We temporarly boost the priority of awaking VCPUs!
+     *
+     * If this VCPU consumes a non negligeable amount of CPU, it
+     * will eventually find itself in the credit accounting code
+     * path where its priority will be reset to normal.
+     *
+     * If on the other hand the VCPU consumes little CPU and is
+     * blocking and awoken a lot (doing I/O for example), its
+     * priority will remain boosted, optimizing it's wake-to-run
+     * latencies.
+     *
+     * This allows wake-to-run latency sensitive VCPUs to preempt
+     * more CPU resource intensive VCPUs without impacting overall 
+     * system fairness.
+     */
+    if ( svc->pri == CSCHED_PRI_TS_UNDER )
+        svc->pri = CSCHED_PRI_TS_BOOST;
+
     /* Put the VCPU on the runq and tickle CPUs */
     __runq_insert(cpu, svc);
     __runq_tickle(cpu, svc);
@@ -659,7 +687,7 @@ csched_runq_sort(unsigned int cpu)
         next = elem->next;
         svc_elem = __runq_elem(elem);
 
-        if ( svc_elem->pri == CSCHED_PRI_TS_UNDER )
+        if ( svc_elem->pri >= CSCHED_PRI_TS_UNDER )
         {
             /* does elem need to move up the runq? */
             if ( elem->prev != last_under )

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

  parent reply	other threads:[~2006-10-25 10:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-18 11:49 [Q] about Credit Scheduler Dom0 Scheduling policy Atsushi SAKAI
2006-10-18 13:11 ` Emmanuel Ackaouy
2006-10-18 13:24   ` Emmanuel Ackaouy
2006-10-23  4:13     ` Atsushi SAKAI
2006-10-23 14:32       ` Emmanuel Ackaouy
2006-10-24  6:46         ` Atsushi SAKAI
2006-10-24  9:49           ` Emmanuel Ackaouy
2006-10-25 10:29           ` Emmanuel Ackaouy [this message]
2006-10-25 13:02             ` Atsushi SAKAI
2006-10-25 14:03               ` Emmanuel Ackaouy
2006-10-26  6:15                 ` Atsushi SAKAI
2006-10-26  8:35                   ` Atsushi SAKAI
2006-10-26  8:42                     ` Emmanuel Ackaouy
2006-10-26 12:52                       ` Pasi Kärkkäinen
2006-10-26 13:04                         ` Emmanuel Ackaouy
2006-10-26 13:47                           ` Pasi Kärkkäinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061025102948.GA32281@cockermouth.uk.xensource.com \
    --to=ack@xensource.com \
    --cc=sakaia@jp.fujitsu.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.