linux-s390.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFC 0/3] improve wait logic of stop_machine
@ 2019-06-08 11:08 Heiko Carstens
  2019-06-08 11:08 ` [PATCH/RFC 1/3] processor: remove spin_cpu_yield Heiko Carstens
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Heiko Carstens @ 2019-06-08 11:08 UTC (permalink / raw)
  To: Peter Zijlstra, Thomas Gleixner, Christian Borntraeger,
	Michael Ellerman, Paul Mackerras
  Cc: linux-kernel, linux-s390

The stop_machine loop to advance the state machine and to wait for all
affected CPUs to check-in calls cpu_relax_yield in a tight loop until
the last missing CPUs acknowledged the state transition.

On a virtual system where not all logical CPUs are backed by real CPUs
all the time it can take a while for all CPUs to check-in. With the
current definition of cpu_relax_yield on s390 a diagnose 0x44 is done
which tells the hypervisor to schedule *some* other CPU. That can be
any CPU and not necessarily one of the CPUs that need to run in order
to advance the state machine. This can lead to a pretty bad diagnose
0x44 storm until the last missing CPU finally checked-in.

Replace the undirected cpu_relax_yield based on diagnose 0x44 with an
architecture specific directed yield. Each CPU in the wait loop will
pick up the next CPU in the cpumask of stop_machine. The diagnose 0x9c
is used to tell the hypervisor to run this next CPU instead of the
current one. If there is only a limited number of real CPUs backing
the virtual CPUs we end up with the real CPUs passed around in a
round-robin fashion.

Patches 1 and 3 are just possible cleanups; the interesting part is
patch 2.

Heiko Carstens (2):
  processor: remove spin_cpu_yield
  processor: get rid of cpu_relax_yield

Martin Schwidefsky (1):
  s390: improve wait logic of stop_machine

 arch/powerpc/include/asm/processor.h |  2 --
 arch/s390/include/asm/processor.h    |  7 +------
 arch/s390/kernel/processor.c         | 21 +++++++++++++++------
 arch/s390/kernel/smp.c               |  2 +-
 include/linux/processor.h            |  9 ---------
 include/linux/sched.h                |  4 ----
 include/linux/stop_machine.h         |  1 +
 kernel/stop_machine.c                | 19 ++++++++++++++-----
 8 files changed, 32 insertions(+), 33 deletions(-)

-- 
2.17.1

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

end of thread, other threads:[~2019-06-11 11:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-08 11:08 [PATCH/RFC 0/3] improve wait logic of stop_machine Heiko Carstens
2019-06-08 11:08 ` [PATCH/RFC 1/3] processor: remove spin_cpu_yield Heiko Carstens
2019-06-08 11:08 ` [PATCH/RFC 2/3] s390: improve wait logic of stop_machine Heiko Carstens
2019-06-11  9:15   ` Peter Zijlstra
2019-06-11 11:21     ` Heiko Carstens
2019-06-08 11:08 ` [PATCH/RFC 3/3] processor: get rid of cpu_relax_yield Heiko Carstens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).