From patchwork Mon Jun 17 20:35:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaro Koskinen X-Patchwork-Id: 11000453 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 40F1B6C5 for ; Mon, 17 Jun 2019 20:35:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31E06288E6 for ; Mon, 17 Jun 2019 20:35:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 259F6289F2; Mon, 17 Jun 2019 20:35:34 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 028EF288DA for ; Mon, 17 Jun 2019 20:35:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=/IaCbkdbN90D8dyqPpYCv77MtRh26XREuUO1I8xfG0M=; b=YIZ qxgvsaQ+yeKsAhthtWeRvD+7dIBL8fw5pguVGIHg/xbCKrGSwea/GN2GXSYau9K9L5KeaVPWd21QQ UyS+/Rpks/UPaF2kduAl5aHWwVKWpRwqV0ZqPpE6iuUe7kCqu9K+zDzQGhMwSPvsMwH5USZdqfHuo /fostvgFnqSVw8YjR+P6nshS0jIAJaLoJmfjFwgtvV7qqR1uH2sEBBC9l2RYRNs+Z8bIQ5YSGK+ku cIRnqF0a7gpnjmh48z46cesoKVpoqnelpKFE5pxQI+mNaXrtSYSzyVCp/HhR2Yx4g8t7aI8Z6zZek C3CWSd4ObII+ngGDXrvx1JR/S4L4mJQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hcyLk-0002mu-5R; Mon, 17 Jun 2019 20:35:32 +0000 Received: from emh01.mail.saunalahti.fi ([62.142.5.107]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hcyLe-0002lW-Tt for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2019 20:35:29 +0000 Received: from localhost.localdomain (85-76-83-177-nat.elisa-mobile.fi [85.76.83.177]) by emh01.mail.saunalahti.fi (Postfix) with ESMTP id 180A72004A; Mon, 17 Jun 2019 23:35:19 +0300 (EEST) From: Aaro Koskinen To: Catalin Marinas , Will Deacon , James Morse , Jayachandran Chandrasekharan Nair Subject: [PATCH v2 1/2] arm64: Improve parking of stopped CPUs Date: Mon, 17 Jun 2019 23:35:18 +0300 Message-Id: <20190617203519.328-1-aaro.koskinen@iki.fi> X-Mailer: git-send-email 2.17.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190617_133527_135112_AB8F98E5 X-CRM114-Status: UNSURE ( 7.93 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aaro Koskinen , linux-arm-kernel@lists.infradead.org, Aaro Koskinen MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jayachandran C The current code puts the stopped cpus in an 'yield' instruction loop. Using a busy loop here is unnecessary, we can use the cpu_park_loop() function here to do a wfi/wfe. Signed-off-by: Jayachandran C Signed-off-by: Aaro Koskinen Acked-by: Will Deacon --- v2: Add Acked-by v1: https://patchwork.kernel.org/patch/10988099/ arch/arm64/kernel/smp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index bb4b3f07761a..1a1b96a50245 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -854,9 +854,7 @@ static void ipi_cpu_stop(unsigned int cpu) local_daif_mask(); sdei_mask_local_cpu(); - - while (1) - cpu_relax(); + cpu_park_loop(); } #ifdef CONFIG_KEXEC_CORE