All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] Add a new acquire resource to query vcpu statistics
@ 2022-05-17 14:33 Matias Ezequiel Vara Larsen
  2022-05-17 14:33 ` [RFC PATCH 1/2] xen/memory : Add stats_table resource type Matias Ezequiel Vara Larsen
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Matias Ezequiel Vara Larsen @ 2022-05-17 14:33 UTC (permalink / raw)
  To: xen-devel
  Cc: Matias Ezequiel Vara Larsen, Andrew Cooper, George Dunlap,
	Jan Beulich, Julien Grall, Stefano Stabellini, Wei Liu,
	Dario Faggioli, Anthony PERARD

Hello all,

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 get those
statistics is by querying the hypervisor. This mechanism relies on a hypercall
and holds the domctl spinlock during its execution. When a pv tool like xcp-rrdd
periodically samples these counters, it ends up affecting other paths that share
that spinlock. By using acquire resources, the pv tool only requires a few
hypercalls to set the shared memory region and samples are got without issuing
any other hypercall. The original idea has been suggested by Andrew Cooper to
which I have been discussing about how to implement the current PoC. You can
find the RFC patch series at [1]. The series is rebased on top of stable-4.15.

I am currently a bit blocked on 1) what to expose and 2) how to expose it. For
1), I decided to expose what xcp-rrdd is querying, e.g., XEN_DOMCTL_getvcpuinfo.
More precisely, xcp-rrd gets runstate.time[RUNSTATE_running]. This is a uint64_t
counter. However, the time spent in other states may be interesting too.
Regarding 2), I am not sure if simply using an array of uint64_t is enough or if
a different interface should be exposed. The remaining question is when to get
new values. For the moment, I am updating this counter during
vcpu_runstate_change().

The current series includes a simple pv tool that shows how this new interface is
used. This tool maps the counter and periodically 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      | 83 +++++++++++++++++++++++++++++++++++++
 xen/common/domain.c         | 42 +++++++++++++++++++
 xen/common/memory.c         | 29 +++++++++++++
 xen/common/sched/core.c     |  5 +++
 xen/include/public/memory.h |  1 +
 xen/include/xen/sched.h     |  5 +++
 7 files changed, 170 insertions(+)
 create mode 100644 tools/misc/xen-stats.c

-- 
2.25.1



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-06-29  9:44 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-17 14:33 [RFC PATCH 0/2] Add a new acquire resource to query vcpu statistics Matias Ezequiel Vara Larsen
2022-05-17 14:33 ` [RFC PATCH 1/2] xen/memory : Add stats_table resource type Matias Ezequiel Vara Larsen
2022-06-17 20:54   ` George Dunlap
2022-06-29  9:44     ` Matias Ezequiel Vara Larsen
2022-06-22  8:59   ` Jan Beulich
2022-06-22 10:05     ` George Dunlap
2022-06-22 10:09       ` Jan Beulich
2022-05-17 14:33 ` [RFC PATCH 2/2] tools/misc: Add xen-stats tool Matias Ezequiel Vara Larsen
2022-05-31 11:16   ` Anthony PERARD
2022-06-03 11:08     ` Matias Ezequiel Vara Larsen
2022-06-20  8:56       ` Matias Ezequiel Vara Larsen
2022-06-17  3:26 ` [RFC PATCH 0/2] Add a new acquire resource to query vcpu statistics Henry Wang
2022-06-17 19:54 ` George Dunlap
2022-06-24 13:06   ` Matias Ezequiel Vara Larsen

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.