diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-12-10 14:05:41 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-12-10 14:05:41 +0000 |
commit | aa9c44021251b17ad24add472751e03b5718cbde (patch) | |
tree | 7bc56f75c711db3a4900c2813481173b16827ffe /xen/common/sysctl.c | |
parent | 7132ae7e553f5dead2cb246165490ad4155ee83b (diff) | |
download | xen-aa9c44021251b17ad24add472751e03b5718cbde.tar.gz xen-aa9c44021251b17ad24add472751e03b5718cbde.tar.bz2 xen-aa9c44021251b17ad24add472751e03b5718cbde.zip |
Avoid negative runstate pieces.
Also consolidate all places to get cpu idle time.
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/common/sysctl.c')
-rw-r--r-- | xen/common/sysctl.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c index 9350cfe3c2..93dd2ffe58 100644 --- a/xen/common/sysctl.c +++ b/xen/common/sysctl.c @@ -167,7 +167,6 @@ long do_sysctl(XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl) { uint32_t i, nr_cpus; struct xen_sysctl_cpuinfo cpuinfo; - struct vcpu *v; nr_cpus = min_t(uint32_t, op->u.getcpuinfo.max_cpus, NR_CPUS); @@ -177,13 +176,7 @@ long do_sysctl(XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl) for ( i = 0; i < nr_cpus; i++ ) { - /* Assume no holes in idle-vcpu map. */ - if ( (v = idle_vcpu[i]) == NULL ) - break; - - cpuinfo.idletime = v->runstate.time[RUNSTATE_running]; - if ( v->is_running ) - cpuinfo.idletime += NOW() - v->runstate.state_entry_time; + cpuinfo.idletime = get_cpu_idle_time(i); ret = -EFAULT; if ( copy_to_guest_offset(op->u.getcpuinfo.info, i, &cpuinfo, 1) ) |