From patchwork Tue Oct 25 09:03:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Borntraeger X-Patchwork-Id: 9394191 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CCBBE60231 for ; Tue, 25 Oct 2016 09:06:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA2BB28598 for ; Tue, 25 Oct 2016 09:06:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AEC0D29469; Tue, 25 Oct 2016 09:06:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4A4A628598 for ; Tue, 25 Oct 2016 09:06:40 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1byxdo-0006lu-1F; Tue, 25 Oct 2016 09:03:28 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1byxdn-0006lo-2L for xen-devel@lists.xenproject.org; Tue, 25 Oct 2016 09:03:27 +0000 Received: from [193.109.254.147] by server-3.bemta-6.messagelabs.com id 53/EB-04595-EDF1F085; Tue, 25 Oct 2016 09:03:26 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphleJIrShJLcpLzFFi42KZsngeq+5def4 Ig72HlS2+b5nM5MDocfjDFZYAxijWzLyk/IoE1oxvm3gLWrkr9n1/w9LAOJuzi5GTQ0jgMqPE 0mu5XYxcQHYLk8TT/0eYIZxnjBKn+k9AOdcZJXq33GCHaPnJKNF/xAoi0cAk0fB8HSOE84pRY lrfcyhnGZPE4r/LmKDKGCVu3LrEDNLPJmAicWHDTDYQW0RAU2Jl2302kCJmgZOsEv/efQRLCA u4STy6vY0VxGYRUJW43H2LCcSWEJCT2LZlDyOIzSngLnHi3CxmiKPcJD6ffs8KUSMiMfHvezY IW1Xi4pyZQDUcQLaORMddWYiwhcSKhqtQ5UYSM98vAivnBRrT+v0+1KosiUN7N4I9ICHwn1Fi 1oPpzBMYJRcwMqxi1ChOLSpLLdI1NNJLKspMzyjJTczM0TU0MNPLTS0uTkxPzUlMKtZLzs/dx AiMHQYg2MF4eWPAIUZJDiYlUd7Gz3wRQnxJ+SmVGYnFGfFFpTmpxYcYZTg4lCR4v8nxRwgJFq Wmp1akZeYAoxgmLcHBoyTC2weS5i0uSMwtzkyHSJ1iVJQS5z0OkhAASWSU5sG1wRLHJUZZKWF eRqBDhHgKUotyM0tQ5V8xinMwKgnzcgLTkBBPZl4J3HRgpALdLMIrGM8DsrgkESEl1cDIey1b jsPqZYhqvocf6xbekv2rNmU1JBzXearfzqo0VfZm2YoYVo8ZB6pdqoMl+tWLjlaELvz7onra6 teThFRk20+ukL7yiDdy4o2Z72X1c6ZLlj7d2LV8koTSot6Ca5orHYp0U5VVjPakJUV4rWc3F4 neFX3jx82315snX2HlZir5J3t65kIlluKMREMt5qLiRAAKnJIaFwMAAA== X-Env-Sender: borntraeger@de.ibm.com X-Msg-Ref: server-14.tower-27.messagelabs.com!1477386204!54944754!1 X-Originating-IP: [148.163.158.5] X-SpamReason: No, hits=0.0 required=7.0 tests=UNPARSEABLE_RELAY X-StarScan-Received: X-StarScan-Version: 9.0.13; banners=-,-,- X-VirusChecked: Checked Received: (qmail 27123 invoked from network); 25 Oct 2016 09:03:25 -0000 Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP; 25 Oct 2016 09:03:25 -0000 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9P8xEXJ014315 for ; Tue, 25 Oct 2016 05:03:24 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 26a4bwr7ce-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 25 Oct 2016 05:03:24 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 25 Oct 2016 10:03:21 +0100 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 25 Oct 2016 10:03:21 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 7B232219006D for ; Tue, 25 Oct 2016 10:02:36 +0100 (BST) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u9P93KWa31064304 for ; Tue, 25 Oct 2016 09:03:20 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u9P93IjN017389 for ; Tue, 25 Oct 2016 03:03:20 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u9P93Ipi017363 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 25 Oct 2016 03:03:18 -0600 Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 25651) id 7D35B20F627; Tue, 25 Oct 2016 11:03:18 +0200 (CEST) From: Christian Borntraeger To: Peter Zijlstra Date: Tue, 25 Oct 2016 11:03:12 +0200 X-Mailer: git-send-email 2.5.5 In-Reply-To: <1477386195-32736-1-git-send-email-borntraeger@de.ibm.com> References: <1477386195-32736-1-git-send-email-borntraeger@de.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16102509-0040-0000-0000-0000024C7739 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16102509-0041-0000-0000-0000224CBAF2 Message-Id: <1477386195-32736-3-git-send-email-borntraeger@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-10-25_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610250152 Cc: linux-arch@vger.kernel.org, linux-s390 , kvm@vger.kernel.org, Christian Borntraeger , Will Deacon , x86@kernel.org, Heiko Carstens , linux-kernel@vger.kernel.org, Nicholas Piggin , Russell King , sparclinux@vger.kernel.org, Noam Camus , Catalin Marinas , Martin Schwidefsky , xen-devel@lists.xenproject.org, virtualization@lists.linux-foundation.org, linuxppc-dev@lists.ozlabs.org, Ingo Molnar Subject: [Xen-devel] [GIT PULL v2 2/5] stop_machine: yield CPU during stop machine X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Some time ago commit 57f2ffe14fd125c2 ("s390: remove diag 44 calls from cpu_relax()") did stop 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, the 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 --- 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) {