From: NISHIGUCHI Naoki <nisiguti@jp.fujitsu.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>,
xen-devel@lists.xensource.com
Cc: Ian.Pratt@eu.citrix.com, disheng.su@intel.com, aviv@neocleus.com,
keir.fraser@eu.citrix.com, sakaia@jp.fujitsu.com
Subject: [RFC][PATCH 1/4] sched: more accurate credit scheduling
Date: Thu, 18 Dec 2008 12:00:54 +0900 [thread overview]
Message-ID: <4949BCE6.3010803@jp.fujitsu.com> (raw)
In-Reply-To: <4949BC2C.4060302@jp.fujitsu.com>
[-- Attachment #1: Type: text/plain, Size: 399 bytes --]
By applying this patch, the credit scheduler subtracts accurately credit
consumed and sets correctly priority.
CSCHED_CREDITS_PER_TICK is changed from 100 to 10000, because vcpu's
credit is subtracted in csched_schedule().
The difference between this patch and last patch is that start_time
variable was moved from csched_vcpu structure to csched_pcpu structure.
Best regards,
Naoki Nishiguchi
[-- Attachment #2: credit_rev2_1_accurate.patch --]
[-- Type: text/x-patch, Size: 2147 bytes --]
diff -r 6595393a3d28 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c Tue Dec 09 16:28:02 2008 +0000
+++ b/xen/common/sched_credit.c Tue Dec 16 19:15:18 2008 +0900
@@ -42,7 +42,7 @@
#define CSCHED_MSECS_PER_TICK 10
#define CSCHED_MSECS_PER_TSLICE \
(CSCHED_MSECS_PER_TICK * CSCHED_TICKS_PER_TSLICE)
-#define CSCHED_CREDITS_PER_TICK 100
+#define CSCHED_CREDITS_PER_TICK 10000
#define CSCHED_CREDITS_PER_TSLICE \
(CSCHED_CREDITS_PER_TICK * CSCHED_TICKS_PER_TSLICE)
#define CSCHED_CREDITS_PER_ACCT \
@@ -188,6 +188,7 @@ struct csched_pcpu {
uint32_t runq_sort_last;
struct timer ticker;
unsigned int tick;
+ s_time_t start_time;
};
/*
@@ -545,11 +546,6 @@ csched_vcpu_acct(unsigned int cpu)
svc->pri = CSCHED_PRI_TS_UNDER;
/*
- * Update credits
- */
- atomic_sub(CSCHED_CREDITS_PER_TICK, &svc->credit);
-
- /*
* Put this VCPU and domain back on the active list if it was
* idling.
*
@@ -1168,12 +1164,27 @@ csched_schedule(s_time_t now)
{
const int cpu = smp_processor_id();
struct list_head * const runq = RUNQ(cpu);
+ struct csched_pcpu * const spc = CSCHED_PCPU(cpu);
struct csched_vcpu * const scurr = CSCHED_VCPU(current);
struct csched_vcpu *snext;
struct task_slice ret;
+ s_time_t passed = now - spc->start_time;
+ int consumed;
CSCHED_STAT_CRANK(schedule);
CSCHED_VCPU_CHECK(current);
+
+ /*
+ * Update credit
+ */
+ consumed = ( passed +
+ (MILLISECS(CSCHED_MSECS_PER_TSLICE) /
+ CSCHED_CREDITS_PER_TSLICE - 1)
+ ) /
+ ( MILLISECS(CSCHED_MSECS_PER_TSLICE) /
+ CSCHED_CREDITS_PER_TSLICE );
+ if ( consumed > 0 && !is_idle_vcpu(current) )
+ atomic_sub(consumed, &scurr->credit);
/*
* Select next runnable local VCPU (ie top of local runq)
@@ -1217,6 +1228,8 @@ csched_schedule(s_time_t now)
*/
ret.time = MILLISECS(CSCHED_MSECS_PER_TSLICE);
ret.task = snext->vcpu;
+
+ spc->start_time = now;
CSCHED_VCPU_CHECK(ret.task);
return ret;
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2008-12-18 3:00 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-18 2:57 [RFC][PATCH 0/4] Modification of credit scheduler rev2 NISHIGUCHI Naoki
2008-12-18 3:00 ` NISHIGUCHI Naoki [this message]
2008-12-18 3:02 ` [RFC][PATCH 2/4] sched: change the handling of credits over upper bound NISHIGUCHI Naoki
2008-12-18 3:04 ` [RFC][PATCH 3/4] sched: balance credits of each vcpu of a domain NISHIGUCHI Naoki
2008-12-18 3:06 ` [RFC][PATCH 4/4] sched: introduce boost credit for latency-sensitive domain NISHIGUCHI Naoki
2009-01-13 8:10 ` [RFC][PATCH 0/4] Modification of credit scheduler rev2 Su, Disheng
2009-01-15 2:04 ` NISHIGUCHI Naoki
2009-01-15 2:56 ` Tian, Kevin
2009-01-15 4:42 ` NISHIGUCHI Naoki
2009-01-15 5:04 ` Tian, Kevin
2009-01-15 6:05 ` NISHIGUCHI Naoki
2009-01-15 6:41 ` Tian, Kevin
2009-01-15 7:01 ` NISHIGUCHI Naoki
2009-01-15 7:04 ` Tian, Kevin
2009-01-15 4:55 ` Su, Disheng
2009-01-15 5:19 ` NISHIGUCHI Naoki
-- strict thread matches above, loose matches on Subject: below --
2008-12-05 10:01 [RFC][PATCH 0/4] Modification of credit scheduler NISHIGUCHI Naoki
2008-12-05 10:05 ` [RFC][PATCH 1/4] sched: more accurate credit scheduling NISHIGUCHI Naoki
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=4949BCE6.3010803@jp.fujitsu.com \
--to=nisiguti@jp.fujitsu.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=Ian.Pratt@eu.citrix.com \
--cc=aviv@neocleus.com \
--cc=disheng.su@intel.com \
--cc=keir.fraser@eu.citrix.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.