diff options
author | Jan Beulich <jbeulich@suse.com> | 2012-12-10 11:14:27 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2012-12-10 11:14:27 +0100 |
commit | 62bc54ce1da4d0000277b94efc680b15fe9127f8 (patch) | |
tree | 7f1821a3a52a5e582811c91d1a90043bc746894d /xen/common/schedule.c | |
parent | fca1c2ebf1e4e35a92f619804e7c9941216ab9e2 (diff) | |
download | xen-62bc54ce1da4d0000277b94efc680b15fe9127f8.tar.gz xen-62bc54ce1da4d0000277b94efc680b15fe9127f8.tar.bz2 xen-62bc54ce1da4d0000277b94efc680b15fe9127f8.zip |
scheduler: fix rate limit range checking
For one, neither of the two checks permitted for the documented value
of zero (disabling the functionality altogether).
Second, the range checking of the command line parameter was done by
the credit scheduler's initialization code, despite it being a generic
scheduler option.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/common/schedule.c')
-rw-r--r-- | xen/common/schedule.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 231e097475..ae798c95dc 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -1324,6 +1324,18 @@ void __init scheduler_init(void) if ( SCHED_OP(&ops, init) ) panic("scheduler returned error on init\n"); + if ( sched_ratelimit_us && + (sched_ratelimit_us > XEN_SYSCTL_SCHED_RATELIMIT_MAX + || sched_ratelimit_us < XEN_SYSCTL_SCHED_RATELIMIT_MIN) ) + { + printk("WARNING: sched_ratelimit_us outside of valid range [%d,%d].\n" + " Resetting to default %u\n", + XEN_SYSCTL_SCHED_RATELIMIT_MIN, + XEN_SYSCTL_SCHED_RATELIMIT_MAX, + SCHED_DEFAULT_RATELIMIT_US); + sched_ratelimit_us = SCHED_DEFAULT_RATELIMIT_US; + } + idle_domain = domain_create(DOMID_IDLE, 0, 0); BUG_ON(IS_ERR(idle_domain)); idle_domain->vcpu = idle_vcpu; |