All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Christian Borntraeger <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux@armlinux.org.uk, npiggin@gmail.com, mingo@kernel.org,
	linux-kernel@vger.kernel.org, schwidefsky@de.ibm.com,
	torvalds@linux-foundation.org, heiko.carstens@de.ibm.com,
	tglx@linutronix.de, borntraeger@de.ibm.com, will.deacon@arm.com,
	catalin.marinas@arm.com, noamc@ezchip.com, hpa@zytor.com,
	peterz@infradead.org
Subject: [tip:locking/core] locking/core, stop_machine: Yield the CPU during stop machine()
Date: Wed, 16 Nov 2016 04:09:28 -0800	[thread overview]
Message-ID: <tip-bf0d31c05411f030e7df9f98b5be4d0c6fd5cd39@git.kernel.org> (raw)
In-Reply-To: <1477386195-32736-3-git-send-email-borntraeger@de.ibm.com>

Commit-ID:  bf0d31c05411f030e7df9f98b5be4d0c6fd5cd39
Gitweb:     http://git.kernel.org/tip/bf0d31c05411f030e7df9f98b5be4d0c6fd5cd39
Author:     Christian Borntraeger <borntraeger@de.ibm.com>
AuthorDate: Tue, 25 Oct 2016 11:03:12 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 16 Nov 2016 10:15:09 +0100

locking/core, stop_machine: Yield the CPU during stop machine()

Some time ago the following commit:

  57f2ffe14fd125c2 ("s390: remove diag 44 calls from cpu_relax()")

... stopped cpu_relax() on s390 yielding to the hypervisor.

As it turns out this made stop_machine() run really slow on virtualized
overcommited systems. For example the kprobes test during bootup took
several seconds instead of just running unnoticed with large guests.

Therefore, yielding was reintroduced with commit:

  4d92f50249eb ("s390: reintroduce diag 44 calls for cpu_relax()")

... but in fact the stop machine code seems to be the only place where
this yielding was really necessary. This place is probably the most
important one as it makes all but one guest CPUs wait for one guest CPU.

As we now have cpu_relax_yield(), we can use this in multi_cpu_stop().
For now lets only add it here. We can add it later in other places
when necessary.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Noam Camus <noamc@ezchip.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: virtualization@lists.linux-foundation.org
Cc: xen-devel@lists.xenproject.org
Link: http://lkml.kernel.org/r/1477386195-32736-3-git-send-email-borntraeger@de.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/stop_machine.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
index ec9ab2f..1eb8266 100644
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
@@ -194,7 +194,7 @@ static int multi_cpu_stop(void *data)
 	/* Simple state machine */
 	do {
 		/* Chill out and ensure we re-read multi_stop_state. */
-		cpu_relax();
+		cpu_relax_yield();
 		if (msdata->state != curstate) {
 			curstate = msdata->state;
 			switch (curstate) {

  reply	other threads:[~2016-11-16 12:10 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-25  9:03 [GIT PULL v2 0/5] cpu_relax: drop lowlatency, introduce yield Christian Borntraeger
2016-10-25  9:03 ` Christian Borntraeger
2016-10-25  9:03 ` [GIT PULL v2 1/5] processor.h: introduce cpu_relax_yield Christian Borntraeger
2016-10-25  9:03   ` Christian Borntraeger
2016-11-15 12:30   ` Russell King - ARM Linux
2016-11-15 12:30   ` Russell King - ARM Linux
2016-11-15 13:19     ` Christian Borntraeger
2016-11-15 13:19       ` Christian Borntraeger
2016-11-15 13:19       ` Christian Borntraeger
2016-11-15 13:37       ` Russell King - ARM Linux
2016-11-15 13:52         ` Christian Borntraeger
2016-11-15 13:52         ` Christian Borntraeger
2016-11-15 13:52           ` Christian Borntraeger
2016-11-15 13:52           ` Christian Borntraeger
2016-11-15 13:37       ` Russell King - ARM Linux
2016-11-15 13:37       ` Russell King - ARM Linux
2016-11-15 13:19     ` Christian Borntraeger
2016-11-15 12:30   ` Russell King - ARM Linux
2016-11-16 12:08   ` [tip:locking/core] locking/core: Introduce cpu_relax_yield() tip-bot for Christian Borntraeger
2016-10-25  9:03 ` [GIT PULL v2 1/5] processor.h: introduce cpu_relax_yield Christian Borntraeger
2016-10-25  9:03 ` Christian Borntraeger
2016-10-25  9:03 ` [GIT PULL v2 2/5] stop_machine: yield CPU during stop machine Christian Borntraeger
2016-10-25  9:03 ` Christian Borntraeger
2016-10-25  9:03   ` Christian Borntraeger
2016-10-25  9:03   ` Christian Borntraeger
2016-11-16 12:09   ` tip-bot for Christian Borntraeger [this message]
2016-10-25  9:03 ` [GIT PULL v2 3/5] s390: make cpu_relax a barrier again Christian Borntraeger
2016-10-25  9:03 ` Christian Borntraeger
2016-10-25  9:03   ` Christian Borntraeger
2016-10-25  9:03   ` Christian Borntraeger
2016-11-16 12:09   ` [tip:locking/core] locking/core, s390: Make cpu_relax() " tip-bot for Christian Borntraeger
2016-10-25  9:03 ` [GIT PULL v2 4/5] processor.h: Remove cpu_relax_lowlatency users Christian Borntraeger
2016-10-25  9:03   ` Christian Borntraeger
2016-10-25  9:03   ` Christian Borntraeger
2016-11-16 12:10   ` [tip:locking/core] locking/core: Remove cpu_relax_lowlatency() users tip-bot for Christian Borntraeger
2016-10-25  9:03 ` [GIT PULL v2 4/5] processor.h: Remove cpu_relax_lowlatency users Christian Borntraeger
2016-10-25  9:03 ` [GIT PULL v2 5/5] processor.h: remove cpu_relax_lowlatency Christian Borntraeger
2016-10-25  9:03   ` Christian Borntraeger
2016-11-16 12:11   ` [tip:locking/core] locking/core, arch: Remove cpu_relax_lowlatency() tip-bot for Christian Borntraeger
2016-10-25  9:03 ` [GIT PULL v2 5/5] processor.h: remove cpu_relax_lowlatency Christian Borntraeger
2016-10-25  9:03 ` Christian Borntraeger
2016-11-15 10:15 ` [GIT PULL v2 0/5] cpu_relax: drop lowlatency, introduce yield Christian Borntraeger
2016-11-15 10:15   ` Christian Borntraeger
2016-11-15 10:15 ` Christian Borntraeger
2016-11-15 10:15 ` Christian Borntraeger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-bf0d31c05411f030e7df9f98b5be4d0c6fd5cd39@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=borntraeger@de.ibm.com \
    --cc=catalin.marinas@arm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mingo@kernel.org \
    --cc=noamc@ezchip.com \
    --cc=npiggin@gmail.com \
    --cc=peterz@infradead.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.