public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/3] KVM: s390: add counters for vsie performance
@ 2023-05-09 11:11 Nico Boehr
  2023-05-09 11:12 ` [PATCH v1 1/3] KVM: s390: fix space before open parenthesis Nico Boehr
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Nico Boehr @ 2023-05-09 11:11 UTC (permalink / raw)
  To: borntraeger, frankja, imbrenda, david; +Cc: kvm, linux-s390

When running a guest-3 via VSIE, guest-1 needs to shadow the page table
structures of guest-2.

To reflect changes of the guest-2 in the _shadowed_ page table structures,
the _shadowing_ sturctures sometimes need to be rebuilt. Since this is a
costly operation, it should be avoided whenever possible.

This series adds kvm stat counters to count the number of shadow gmaps
created and a tracepoint whenever something is unshadowed. This is a first
step to try and improve VSIE performance.

Please note that "KVM: s390: add tracepoint in gmap notifier" has some
checkpatch --strict findings. I did not fix these since the tracepoint
definition would then look completely different from all the other
tracepoints in arch/s390/kvm/trace-s390.h. If you want me to fix that,
please let me know.

While developing this, a question regarding the stat counters came up:
there's usually no locking involved when the stat counters are incremented.
On s390, GCC accidentally seems to do the right thing(TM) most of the time
by generating a agsi instruction (which should be atomic given proper
alignment). However, it's not guaranteed, so would we rather want to go
with an atomic for the stat counters to avoid losing events? Or do we just
accept the fact that we might loose events sometimes? Is there anything
that speaks against having an atomic in kvm_stat?

Nico Boehr (3):
  KVM: s390: fix space before open parenthesis
  KVM: s390: add stat counter for shadow gmap events
  KVM: s390: add tracepoint in gmap notifier

 arch/s390/include/asm/kvm_host.h |  7 ++++++-
 arch/s390/kvm/gaccess.c          |  6 ++++++
 arch/s390/kvm/kvm-s390.c         |  9 ++++++++-
 arch/s390/kvm/trace-s390.h       | 23 +++++++++++++++++++++++
 arch/s390/kvm/vsie.c             |  1 +
 5 files changed, 44 insertions(+), 2 deletions(-)

-- 
2.39.1


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

end of thread, other threads:[~2023-05-10  6:45 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-09 11:11 [PATCH v1 0/3] KVM: s390: add counters for vsie performance Nico Boehr
2023-05-09 11:12 ` [PATCH v1 1/3] KVM: s390: fix space before open parenthesis Nico Boehr
2023-05-09 11:19   ` Claudio Imbrenda
2023-05-09 11:12 ` [PATCH v1 2/3] KVM: s390: add stat counter for shadow gmap events Nico Boehr
2023-05-09 11:43   ` Claudio Imbrenda
2023-05-09 14:53     ` Nico Boehr
2023-05-09 15:17       ` Claudio Imbrenda
2023-05-09 11:59   ` Janosch Frank
2023-05-09 14:54     ` Nico Boehr
2023-05-09 15:14       ` Claudio Imbrenda
2023-05-10  6:45         ` Janosch Frank
2023-05-09 11:12 ` [PATCH v1 3/3] KVM: s390: add tracepoint in gmap notifier Nico Boehr
2023-05-09 11:48   ` Claudio Imbrenda
2023-05-09 14:54     ` Nico Boehr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox