public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] KVM: s390: Couple of small cmpxchg() optimizations
@ 2024-11-25 11:50 Heiko Carstens
  2024-11-25 11:50 ` [PATCH 1/3] KVM: s390: Use try_cmpxchg() instead of cmpxchg() loops Heiko Carstens
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Heiko Carstens @ 2024-11-25 11:50 UTC (permalink / raw)
  To: Christian Borntraeger, Janosch Frank, Claudio Imbrenda,
	David Hildenbrand
  Cc: kvm, linux-s390, linux-kernel

Use try_cmpxchg() instead of cmpxchg() so compilers with flag output
operand support (gcc 14 and newer) can generate slightly better code.

Also get rid of two cmpxchg() usages on one/two byte memory areas
which generates inefficient code.

bloat-o-meter statistics of the kvm module:

add/remove: 0/0 grow/shrink: 0/11 up/down: 0/-318 (-318)
Function                                     old     new   delta
kvm_s390_handle_wait                         886     880      -6
kvm_s390_gisa_destroy                        226     220      -6
kvm_s390_gisa_clear                           96      90      -6
ipte_unlock                                  380     372      -8
kvm_s390_gisc_unregister                     270     260     -10
kvm_s390_gisc_register                       290     280     -10
gisa_vcpu_kicker                             200     190     -10
account_mem                                  250     232     -18
ipte_lock                                    416     368     -48
kvm_s390_update_topology_change_report       174     122     -52
kvm_s390_clear_local_irqs                    420     276    -144
Total: Before=316521, After=316203, chg -0.10%

Heiko Carstens (3):
  KVM: s390: Use try_cmpxchg() instead of cmpxchg() loops
  KVM: s390: Remove one byte cmpxchg() usage
  KVM: s390: Increase size of union sca_utility to four bytes

 arch/s390/include/asm/kvm_host.h | 10 +++++-----
 arch/s390/kvm/gaccess.c          | 16 ++++++++--------
 arch/s390/kvm/interrupt.c        | 25 ++++++++-----------------
 arch/s390/kvm/kvm-s390.c         |  4 ++--
 arch/s390/kvm/pci.c              |  5 ++---
 5 files changed, 25 insertions(+), 35 deletions(-)


base-commit: 9f16d5e6f220661f73b36a4be1b21575651d8833
-- 
2.45.2


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

end of thread, other threads:[~2024-11-25 16:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-25 11:50 [PATCH 0/3] KVM: s390: Couple of small cmpxchg() optimizations Heiko Carstens
2024-11-25 11:50 ` [PATCH 1/3] KVM: s390: Use try_cmpxchg() instead of cmpxchg() loops Heiko Carstens
2024-11-25 12:18   ` Claudio Imbrenda
2024-11-25 11:50 ` [PATCH 2/3] KVM: s390: Remove one byte cmpxchg() usage Heiko Carstens
2024-11-25 12:16   ` Claudio Imbrenda
2024-11-25 13:37     ` Heiko Carstens
2024-11-25 16:20       ` Claudio Imbrenda
2024-11-25 11:50 ` [PATCH 3/3] KVM: s390: Increase size of union sca_utility to four bytes Heiko Carstens
2024-11-25 12:20   ` Claudio Imbrenda
2024-11-25 13:40     ` Heiko Carstens
2024-11-25 16:17       ` Claudio Imbrenda

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