From: Ryan Harper <ryanh@us.ibm.com>
To: Guillaume Thouvenin <guillaume.thouvenin@bull.fr>
Cc: khoa@us.ibm.com, xen-devel@lists.xensource.com,
JEAN-PIERRE DION <Jean-Pierre.Dion@bull.net>,
Gerrit Huizenga <gh@us.ibm.com>
Subject: [PATCH] xen: fix empty slice bug in sedf_adjdom()
Date: Wed, 22 Feb 2006 15:39:06 -0600 [thread overview]
Message-ID: <20060222213906.GD3263@us.ibm.com> (raw)
In-Reply-To: <20060202133746.2e7f9429@localhost.localdomain>
Whenever the slice of a domU is set to 0, sedf_adjdom() sets extraweight
to 0. Later, in desched_extra_dom(), if the extrawight is not set, the
vcpu's score is calculated with this:
/*domain was running in L1 extraq => score is inverse of
utilization and is used somewhat incremental!*/
if ( !inf->extraweight )
/*NB: use fixed point arithmetic with 10 bits*/
inf->score[EXTRA_UTIL_Q] = (inf->period << 10) /
inf->slice;
Which can result in a divide by zero.
The attached patch adds a comments and additional sanity check to
prevent this case from crashing Xen.
--
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
(512) 838-9253 T/L: 678-9253
ryanh@us.ibm.com
diffstat output:
sched_sedf.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
---
diff -r 697fac283c9e xen/common/sched_sedf.c
--- a/xen/common/sched_sedf.c Wed Feb 22 19:11:23 2006
+++ b/xen/common/sched_sedf.c Wed Feb 22 15:02:21 2006
@@ -1610,10 +1610,10 @@
/*time driven domains*/
for_each_vcpu(p, v) {
/* sanity checking! */
- if(cmd->u.sedf.slice > cmd->u.sedf.period )
+ if(!cmd->u.sedf.slice || cmd->u.sedf.slice > cmd->u.sedf.period)
return -EINVAL;
EDOM_INFO(v)->weight = 0;
- EDOM_INFO(v)->extraweight = 0;
+ EDOM_INFO(v)->extraweight = 0; /* disabling extra weight requires non-zere slice */
EDOM_INFO(v)->period_orig =
EDOM_INFO(v)->period = cmd->u.sedf.period;
EDOM_INFO(v)->slice_orig =
prev parent reply other threads:[~2006-02-22 21:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-10 9:01 sedf scheduler may cause a CPU fatal trap Guillaume Thouvenin
2006-01-13 8:33 ` Guillaume Thouvenin
2006-01-13 9:59 ` Guillaume Thouvenin
2006-01-13 10:10 ` Keir Fraser
2006-01-16 10:30 ` Guillaume Thouvenin
2006-01-18 8:24 ` Guillaume Thouvenin
2006-02-02 12:37 ` Guillaume Thouvenin
2006-02-22 21:39 ` Ryan Harper [this message]
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=20060222213906.GD3263@us.ibm.com \
--to=ryanh@us.ibm.com \
--cc=Jean-Pierre.Dion@bull.net \
--cc=gh@us.ibm.com \
--cc=guillaume.thouvenin@bull.fr \
--cc=khoa@us.ibm.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.