[RFC PATCH v3 3/3] tools/misc: Add xen-vcpus-stats tool

2023-10-31 Thread Matias Ezequiel Vara Larsen
Add a demonstration tool that uses the stats_table resource to query vcpus' RUNSTATE_running counter for a DomU. Signed-off-by: Matias Ezequiel Vara Larsen --- Changes in v3: - use memory layout as discussed at https://lists.xenproject.org/archives/html/xen-devel/2023-03/msg00383.html - use

[RFC PATCH v3 2/3] x86/mm: Do not validate/devalidate PGT_none type

2023-10-31 Thread Matias Ezequiel Vara Larsen
be marked with PGT_none with a single type ref. In particular, this commit makes the stats_table resource type to use this flag during get_page_and_type(). Signed-off-by: Matias Ezequiel Vara Larsen --- xen/arch/x86/mm.c | 3 ++- xen/common/memory.c | 2 +- 2 files changed, 3 insertions(+), 2 deletion

[RFC PATCH v3 1/3] xen/memory : Add a stats_table resource type

2023-10-31 Thread Matias Ezequiel Vara Larsen
added to host a different sort of counters. [1] https://lists.xenproject.org/archives/html/xen-devel/2023-03/msg00383.html Signed-off-by: Matias Ezequiel Vara Larsen --- Changes in v3: - allow to host an arbitrary nuumber of vcpus - release resource during domain_kill() since it is guest-type

[RFC PATCH v3 0/3] Add a new acquire resource to query vcpu statistics

2023-10-31 Thread Matias Ezequiel Vara Larsen
between the tool and Xen to make it extensible to new counters and declare it in a public header There are still the following questions: - resource shall be released when there are no more readers otherwise we keep updating it during a hot path Matias Ezequiel Vara Larsen (3): xen

Re: [RFC PATCH v2 2/2] tools/misc: Add xen-vcpus-stats tool

2023-03-17 Thread Matias Ezequiel Vara Larsen
On Thu, Feb 23, 2023 at 08:31:29PM +, Julien Grall wrote: > Hi, > > On 23/02/2023 16:01, Andrew Cooper wrote: > > On 07/10/2022 1:39 pm, Matias Ezequiel Vara Larsen wrote: > > > > A couple of observations, all unrelated to the stats themselves. > > >

Re: API/ABIs: Re: [RFC PATCH v2 0/2] Add a new acquire resource to query vcpu statistics

2023-03-14 Thread Matias Ezequiel Vara Larsen
On Fri, Mar 10, 2023 at 12:34:33PM +0100, Jan Beulich wrote: > On 10.03.2023 11:58, Matias Ezequiel Vara Larsen wrote: > > Oh, I see, thanks for the clarification. To summarise, these are the current > > options: > > 1. Use a "uint64_t" field thus limiti

Re: API/ABIs: Re: [RFC PATCH v2 0/2] Add a new acquire resource to query vcpu statistics

2023-03-10 Thread Matias Ezequiel Vara Larsen
On Thu, Mar 09, 2023 at 12:50:18PM +0100, Jan Beulich wrote: > On 09.03.2023 11:38, Matias Ezequiel Vara Larsen wrote: > > On Wed, Mar 08, 2023 at 03:16:05PM +0100, Jan Beulich wrote: > >> On 08.03.2023 12:54, Matias Ezequiel Vara Larsen wrote: > >>> On Tue, Mar 07,

Re: API/ABIs: Re: [RFC PATCH v2 0/2] Add a new acquire resource to query vcpu statistics

2023-03-09 Thread Matias Ezequiel Vara Larsen
On Wed, Mar 08, 2023 at 03:16:05PM +0100, Jan Beulich wrote: > On 08.03.2023 12:54, Matias Ezequiel Vara Larsen wrote: > > On Tue, Mar 07, 2023 at 11:12:00AM +0100, Jan Beulich wrote: > >> On 06.03.2023 15:23, Matias Ezequiel Vara Larsen wrote: > >>> - Xen shal

Re: [RFC PATCH v2 1/2] xen/memory : Add a stats_table resource type

2023-03-09 Thread Matias Ezequiel Vara Larsen
On Tue, Mar 07, 2023 at 05:55:26PM +0100, Jan Beulich wrote: > On 07.03.2023 15:44, Matias Ezequiel Vara Larsen wrote: > > On Thu, Feb 23, 2023 at 01:42:08PM +0100, Jan Beulich wrote: > >> On 23.02.2023 13:16, Matias Ezequiel Vara Larsen wrote: > >>> On Fri, Feb 17,

Re: API/ABIs: Re: [RFC PATCH v2 0/2] Add a new acquire resource to query vcpu statistics

2023-03-08 Thread Matias Ezequiel Vara Larsen
On Tue, Mar 07, 2023 at 11:12:00AM +0100, Jan Beulich wrote: > On 06.03.2023 15:23, Matias Ezequiel Vara Larsen wrote: > > Regarding your email, I have the following comments: > > > > - I still do not know how to choose the value of cacheline_size. I > > unde

Re: [RFC PATCH v2 1/2] xen/memory : Add a stats_table resource type

2023-03-07 Thread Matias Ezequiel Vara Larsen
On Thu, Feb 23, 2023 at 01:42:08PM +0100, Jan Beulich wrote: > On 23.02.2023 13:16, Matias Ezequiel Vara Larsen wrote: > > On Fri, Feb 17, 2023 at 03:10:53PM +0100, Jan Beulich wrote: > >> On 17.02.2023 10:29, Matias Ezequiel Vara Larsen wrote: > >>> On Fri, Feb 17,

Re: API/ABIs: Re: [RFC PATCH v2 0/2] Add a new acquire resource to query vcpu statistics

2023-03-06 Thread Matias Ezequiel Vara Larsen
Hello Andrew and thanks for the comments, please find my comments below. On Thu, Feb 23, 2023 at 07:56:28PM +, Andrew Cooper wrote: > A discussion about forward extensible APIs and ABIs here. > > First, its important to say that this should be "domain stats" and not > just "vcpu stats". 

Re: [RFC PATCH v2 2/2] tools/misc: Add xen-vcpus-stats tool

2023-02-24 Thread Matias Ezequiel Vara Larsen
Hello Andrew and thanks for the comments, On Thu, Feb 23, 2023 at 04:01:09PM +, Andrew Cooper wrote: > On 07/10/2022 1:39 pm, Matias Ezequiel Vara Larsen wrote: > > A couple of observations, all unrelated to the stats themselves. > > Although overall, I'm not entirely cert

Re: [RFC PATCH v2 1/2] xen/memory : Add a stats_table resource type

2023-02-23 Thread Matias Ezequiel Vara Larsen
On Fri, Feb 17, 2023 at 03:10:53PM +0100, Jan Beulich wrote: > On 17.02.2023 10:29, Matias Ezequiel Vara Larsen wrote: > > On Fri, Feb 17, 2023 at 09:57:43AM +0100, Jan Beulich wrote: > >> On 17.02.2023 09:50, Matias Ezequiel Vara Larsen wrote: > >>> On Wed, Dec 14,

Re: [RFC PATCH v2 1/2] xen/memory : Add a stats_table resource type

2023-02-20 Thread Matias Ezequiel Vara Larsen
On Thu, Feb 16, 2023 at 04:15:29PM +0100, Jan Beulich wrote: > On 16.02.2023 16:07, Matias Ezequiel Vara Larsen wrote: > > On Wed, Dec 14, 2022 at 08:29:53AM +0100, Jan Beulich wrote: > >> On 07.10.2022 14:39, Matias Ezequiel Vara Larsen wrote: > >>> @@ -287,6

Re: [RFC PATCH v2 1/2] xen/memory : Add a stats_table resource type

2023-02-17 Thread Matias Ezequiel Vara Larsen
On Fri, Feb 17, 2023 at 09:57:43AM +0100, Jan Beulich wrote: > On 17.02.2023 09:50, Matias Ezequiel Vara Larsen wrote: > > On Wed, Dec 14, 2022 at 08:56:57AM +0100, Jan Beulich wrote: > >> On 14.12.2022 08:29, Jan Beulich wrote: > >>> On 07.10.2022 14:39, Mat

Re: [RFC PATCH v2 1/2] xen/memory : Add a stats_table resource type

2023-02-17 Thread Matias Ezequiel Vara Larsen
On Wed, Dec 14, 2022 at 08:56:57AM +0100, Jan Beulich wrote: > On 14.12.2022 08:29, Jan Beulich wrote: > > On 07.10.2022 14:39, Matias Ezequiel Vara Larsen wrote: > >> +static int stats_vcpu_alloc_mfn(struct domain *d) > >> +{ > >> +struc

Re: [RFC PATCH v2 1/2] xen/memory : Add a stats_table resource type

2023-02-16 Thread Matias Ezequiel Vara Larsen
On Wed, Dec 14, 2022 at 08:29:53AM +0100, Jan Beulich wrote: > On 07.10.2022 14:39, Matias Ezequiel Vara Larsen wrote: > > --- a/xen/common/memory.c > > +++ b/xen/common/memory.c > > @@ -1078,6 +1078,12 @@ unsigned int ioreq_server_max_frames(const struct > > dom

Re: [RFC PATCH v2 1/2] xen/memory : Add a stats_table resource type

2023-02-16 Thread Matias Ezequiel Vara Larsen
Hello Jan and thanks for your comments. I addressed most of the them but I've still some questions. Please find my questions below: On Tue, Dec 13, 2022 at 06:02:55PM +0100, Jan Beulich wrote: > On 07.10.2022 14:39, Matias Ezequiel Vara Larsen wrote: > > This commit proposes a new

[RFC PATCH v2 1/2] xen/memory : Add a stats_table resource type

2022-10-07 Thread Matias Ezequiel Vara Larsen
. Second, new frames can be added in case new counters are required. Signed-off-by: Matias Ezequiel Vara Larsen --- Changes in v2: - rework to ensure that guest reads a coherent value by using a version number in the vcpu_stats structure - add version to the vcpu_stats structure Changes in v1

[RFC PATCH v2 2/2] tools/misc: Add xen-vcpus-stats tool

2022-10-07 Thread Matias Ezequiel Vara Larsen
Add a demonstration tool that uses the stats_table resource to query vcpus' RUNSTATE_running counter for a DomU. Signed-off-by: Matias Ezequiel Vara Larsen --- Changes in v2: - use period instead of frec - rely on version to ensure reading is coherent Changes in v1: - change the name

[RFC PATCH v2 0/2] Add a new acquire resource to query vcpu statistics

2022-10-07 Thread Matias Ezequiel Vara Larsen
we keep updating it during a hot path - one frame can host up to 512 vcpus. Should I check to this limit when updating? Should it be possible to allocate more than one frame for vcpu counters? Matias Ezequiel Vara Larsen (2): xen/memory : Add a stats_table resource type tools

Re: [RFC PATCH v1 0/2] Add a new acquire resource to query vcpu statistics

2022-09-30 Thread Matias Ezequiel Vara Larsen
On Thu, Sep 29, 2022 at 05:55:50PM +0200, Jan Beulich wrote: > On 24.08.2022 15:27, Matias Ezequiel Vara Larsen wrote: > > The purpose of this RFC is to get feedback about a new acquire resource that > > exposes vcpu statistics for a given domain. The current mechanism to

Design session "Using the new VCPU counters in XAPI"

2022-09-23 Thread Matias Ezequiel Vara Larsen
Participants: Pau, Edwin, Matias - the semantics of the new interface for querying registers is now async, this would require a initialization phase in xcp-rrdd before query the counters. - why this https://github.com/xenserver/xen.pg/blob/XS-8.2.x/master/mixed-domain-runstates.patch is not

[RFC PATCH v1] xen/docs: Document acquire resource interface

2022-08-29 Thread Matias Ezequiel Vara Larsen
This commit creates a new doc to document the acquire resource interface. This is a reference document. Signed-off-by: Matias Ezequiel Vara Larsen --- Changes in v1: - correct documentation about how mfns are allocated - correct documentation about how mfns are released - use the wording tool

[RFC PATCH v1 2/2] tools/misc: Add xen-vcpus-stats tool

2022-08-24 Thread Matias Ezequiel Vara Larsen
Add a demostration tool that uses the stats_table resource to query vcpus' RUNSTATE_running counter for a DomU. Signed-off-by: Matias Ezequiel Vara Larsen --- Changes in v1: - change the name of the tool to xen-vcpus-stats - set command line parameters in the same order that are passed - remove

[RFC PATCH v1 1/2] xen/memory : Add a stats_table resource type

2022-08-24 Thread Matias Ezequiel Vara Larsen
. Second, new frames can be added in case new counters are required. Signed-off-by: Matias Ezequiel Vara Larsen --- Changes in v1: - rework the allocation and releasing of the frames - use the zero frame for per-vcpu counters that are listed as an array - allocate vcpu stats frames only when

[RFC PATCH v1 0/2] Add a new acquire resource to query vcpu statistics

2022-08-24 Thread Matias Ezequiel Vara Larsen
a hot path - one frame can host up to 512 vcpus. Should I check to this limit when updating? Should it be possible to allocate more than one frame for vcpu counters? Matias Ezequiel Vara Larsen (2): xen/memory : Add a stats_table resource type tools/misc: Add xen-vcpus-stats

Re: [RFC PATCH 1/2] xen/memory : Add stats_table resource type

2022-06-29 Thread Matias Ezequiel Vara Larsen
ds fixing in > the most efficient manner. :-) > Thanks for the comments :) I have addressed some of them already in the response to the cover letter. > > On 17 May 2022, at 15:33, Matias Ezequiel Vara Larsen > > wrote: > > > > Allow to map vcpu stats using ac

Re: [RFC PATCH 0/2] Add a new acquire resource to query vcpu statistics

2022-06-24 Thread Matias Ezequiel Vara Larsen
Hello George and thanks for the review! you will find my comments below. On Fri, Jun 17, 2022 at 07:54:32PM +, George Dunlap wrote: > > > > On 17 May 2022, at 15:33, Matias Ezequiel Vara Larsen > > wrote: > > > > Hello all, > > > > The purpose

Re: [RFC PATCH 2/2] tools/misc: Add xen-stats tool

2022-06-20 Thread Matias Ezequiel Vara Larsen
Hello Anthony, On Fri, Jun 03, 2022 at 01:08:20PM +0200, Matias Ezequiel Vara Larsen wrote: > Hello Anthony and thanks for your comments. I addressed them below: > > On Tue, May 31, 2022 at 12:16:02PM +0100, Anthony PERARD wrote: > > Hi Matias, > > > > On Tue, May 1

Re: [RFC PATCH 2/2] tools/misc: Add xen-stats tool

2022-06-03 Thread Matias Ezequiel Vara Larsen
Hello Anthony and thanks for your comments. I addressed them below: On Tue, May 31, 2022 at 12:16:02PM +0100, Anthony PERARD wrote: > Hi Matias, > > On Tue, May 17, 2022 at 04:33:15PM +0200, Matias Ezequiel Vara Larsen wrote: > > Add a demostration tool that uses the stats

[RFC PATCH] xen/docs: Document acquire resource interface

2022-05-24 Thread Matias Ezequiel Vara Larsen
This commit creates a new doc to document the acquire resource interface. This is a reference document. Signed-off-by: Matias Ezequiel Vara Larsen --- RFC: The current document still contains TODOs. I am not really sure why different resources are implemented differently. I would like

[RFC PATCH 1/2] xen/memory : Add stats_table resource type

2022-05-17 Thread Matias Ezequiel Vara Larsen
Allow to map vcpu stats using acquire_resource(). Signed-off-by: Matias Ezequiel Vara Larsen --- xen/common/domain.c | 42 + xen/common/memory.c | 29 + xen/common/sched/core.c | 5 + xen/include/public

[RFC PATCH 0/2] Add a new acquire resource to query vcpu statistics

2022-05-17 Thread Matias Ezequiel Vara Larsen
samples it. Any feedback/help would be appreciated. Thanks, Matias. [1] https://github.com/MatiasVara/xen/tree/feature_stats Matias Ezequiel Vara Larsen (2): xen/memory : Add stats_table resource type tools/misc: Add xen-stats tool tools/misc/Makefile | 5 +++ tools/misc/xen-stats.c

[RFC PATCH 2/2] tools/misc: Add xen-stats tool

2022-05-17 Thread Matias Ezequiel Vara Larsen
Add a demostration tool that uses the stats_table resource to query vcpu time for a DomU. Signed-off-by: Matias Ezequiel Vara Larsen --- tools/misc/Makefile| 5 +++ tools/misc/xen-stats.c | 83 ++ 2 files changed, 88 insertions(+) create mode 100644