[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [RFC 3/6] sysctl: extend XEN_SYSCTL_getcpuinfo interface
- To: "andrii.anisov@xxxxxxxxx" <andrii.anisov@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Dario Faggioli <dfaggioli@xxxxxxxx>
- Date: Fri, 26 Jul 2019 12:15:28 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=suse.com;dmarc=pass action=none header.from=suse.com;dkim=pass header.d=suse.com;arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sw59eGsCz5qw+QaOVAmc/DqmFU5bJkoHQkXqtN9fr2g=; b=U52mxlR09oP/JOunZoxUI/WA5XA3PBFrXENj8cygvFIm+BEpmX3qCU6EX2E0aEqb06wueqcOhhgLoh/aoZO8WxXC7XnfPzS6jhtyDTEFwPBdn6NIUX764on35UgGBoZ1dwCo8YZai0ZmWVH4+Z4tK0GLxcEE/QPKVBrh9yUg7xs01/lDSV/n4rCZ4P0+xHOfAMjbYpqbA9sv1oP8JPNsgJfITEqxUyn5tpnYFqDwG5zOUh5VJFRrHiri8mlEu+8yiR6b3DNB+YQ6RZ46srRvv3lbu2y0puLe9udT4CPNRPGurHwM9KBkR3snMwgUSC0NHErmMlOJR/bNeXQkKAMaUg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jpi2tHzRv5KsgSAPxjSoWpvPfGujnj7ayr/THmCeGfmi2w5vbHi0IZowTfPB1/G64ssAuU6YmgG8a/yhlJRxfkim26DgiZTeN6SWLnwQMFTy7Y4uzfx2hX53bBQfpNWrudBWDtfxOqaBkuwOkE2gIKYxL2y7WDtVCO0umRty6w544jy4MDHuW0MTnFoOKuQPa5B3mN5KSRN5hqubl0TeDRktOpgtMxMUxhoreMHq/fxUlUZSIUjOK4d3lt7rd5iElACetc6L44MCmlO2ueBv5AE9Eib+2wil64eIFIIO/XSdJ5zYAV9ZmEt4RqwGzjchZtplHai0+alLXTW3d3bTEQ==
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=dfaggioli@xxxxxxxx;
- Cc: "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "andrii_anisov@xxxxxxxx" <andrii_anisov@xxxxxxxx>, "wl@xxxxxxx" <wl@xxxxxxx>, "konrad.wilk@xxxxxxxxxx" <konrad.wilk@xxxxxxxxxx>, "George.Dunlap@xxxxxxxxxxxxx" <George.Dunlap@xxxxxxxxxxxxx>, "tim@xxxxxxx" <tim@xxxxxxx>, "ian.jackson@xxxxxxxxxxxxx" <ian.jackson@xxxxxxxxxxxxx>, "julien.grall@xxxxxxx" <julien.grall@xxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, "andrew.cooper3@xxxxxxxxxx" <andrew.cooper3@xxxxxxxxxx>
- Delivery-date: Fri, 26 Jul 2019 12:19:33 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHVQ54+rFbPh7Xsl0e/AsQk+PDWkqbc0GAA
- Thread-topic: [Xen-devel] [RFC 3/6] sysctl: extend XEN_SYSCTL_getcpuinfo interface
On Fri, 2019-07-26 at 13:37 +0300, Andrii Anisov wrote:
> diff --git a/xen/common/schedule.c b/xen/common/schedule.c
> index 0a38d4a..9e8805d 100644
> --- a/xen/common/schedule.c
> +++ b/xen/common/schedule.c
> @@ -217,6 +217,28 @@ uint64_t get_cpu_idle_time(unsigned int cpu)
> return state.time[RUNSTATE_blocked];
> }
>
> +uint64_t get_cpu_guest_time(unsigned int cpu)
> +{
> + struct vcpu_runstate_info state = { 0 };
> + struct vcpu *v = idle_vcpu[cpu];
> +
> + if ( cpu_online(cpu) && v )
> + vcpu_runstate_get(v, &state);
> +
> + return state.time[RUNSTATE_runnable];
> +}
> +
Yep, I think being able to know time spent running guests could be
useful.
> +uint64_t get_cpu_hyp_time(unsigned int cpu)
> +{
> + struct vcpu_runstate_info state = { 0 };
> + struct vcpu *v = idle_vcpu[cpu];
> +
> + if ( cpu_online(cpu) && v )
> + vcpu_runstate_get(v, &state);
> +
> + return state.time[RUNSTATE_running];
> +}
> +
>
I confirm what I said about patch 1: idle time being the time idle_vcpu
spent in RUNSTATE_blocked, and hypervisor time being the time idle_vcpu
spent in RUNSTATE_running sounds quite confusing to me.
Regards
--
Dario Faggioli, Ph.D
http://about.me/dario.faggioli
Virtualization Software Engineer
SUSE Labs, SUSE https://www.suse.com/
-------------------------------------------------------------------
<<This happens because _I_ choose it to happen!>> (Raistlin Majere)
Attachment:
signature.asc
Description: This is a digitally signed message part
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|