Received: by 2002:a17:90a:1609:0:0:0:0 with SMTP id n9csp2345836pja; Thu, 26 Mar 2020 13:39:55 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsDxlIXhuXKpbZBxK9Y+im/EPOioos6E1/3SpH0WDBzLMz8at/clSq+NOHYVTWpIVq5pDq3 X-Received: by 2002:a4a:1ec3:: with SMTP id 186mr6503520ooq.66.1585255195495; Thu, 26 Mar 2020 13:39:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585255195; cv=none; d=google.com; s=arc-20160816; b=z46VM9iv5axSo1DRNMgknuDhjuzZbEEl6q6g2r6G0JCLLZfoGosGYKlW6U7u4iaOxO xheugnssxCwyePQtjAgw+akddLEeEQDg20ckkXeLtklDPr9PcKBzEWEXK4neEwKP8cR1 TCa0ezqtnrHL9DW+vu5yklDOXpN5kjiPWlvFHVTuFz6tBWVXYKusdXwg9GUpt67LEmae X1LQIMY6l8EbKB2MDi6woLpRfZBRxLOFlGe4HGZ11iGCSVPgli2gLbvVVplmffBhV39G uZel1+ug3pZDB9RzP5rTqwYfJE7Mi1J6/+JOW46sgZ2aiTIhWUFJUUBBPVQLI7Ld7FO/ C7Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=JLqvHWnWnb88x4znMPu/62ROowLbaY3RlPtrreRqG88=; b=bE7s6WvjJnF9c4lJHQeBWB6BDxs/SXgaRwT0QGA7kN8VZbZMMIBB47IFwuhZS0CR61 iF/pAl5yghayhV6I5RaNKuEZPGW5FyVT5I1y97qa71e4ZU+r6frZYRWb1IAmTn/pWeyb 5b9UyRMqMMBKAzCDXPzxZmvnl3kw0Jwp1cjLVroFAHrz14WsdI/i80sP5fCjIx3nG4Ps MQahSrsfDHKXZpFE24NuU8O8gUolSVaSP6RFM4XRIgOT90HL/dlSpl4p1Tg7VMJimqrZ P1PISQR++lh/VXOEX/2yW+ztjPbSJctwjW9QjaWoLseRh5SzihoWKAXPZntbhS5WEcfW Gn1w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h1si836680otr.127.2020.03.26.13.39.41; Thu, 26 Mar 2020 13:39:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727650AbgCZUjL (ORCPT + 99 others); Thu, 26 Mar 2020 16:39:11 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:13420 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726281AbgCZUjK (ORCPT ); Thu, 26 Mar 2020 16:39:10 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02QKWO9Q008292; Thu, 26 Mar 2020 16:38:39 -0400 Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ywewx5wjs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 26 Mar 2020 16:38:39 -0400 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 02QKbqpA012173; Thu, 26 Mar 2020 20:38:39 GMT Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by ppma04wdc.us.ibm.com with ESMTP id 2ywaw9cjsm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 26 Mar 2020 20:38:39 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 02QKccO954329848 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 26 Mar 2020 20:38:38 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AE881AC05E; Thu, 26 Mar 2020 20:38:38 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5CCFFAC059; Thu, 26 Mar 2020 20:38:26 +0000 (GMT) Received: from LeoBras.aus.stglabs.ibm.com (unknown [9.85.162.45]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 26 Mar 2020 20:38:25 +0000 (GMT) From: Leonardo Bras To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Leonardo Bras , Allison Randal , Greg Kroah-Hartman , Thomas Gleixner Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 1/1] ppc/smp: Replace unnecessary 'while' by 'if' Date: Thu, 26 Mar 2020 17:37:52 -0300 Message-Id: <20200326203752.497029-1-leonardo@linux.ibm.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.645 definitions=2020-03-26_11:2020-03-26,2020-03-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 spamscore=0 clxscore=1015 malwarescore=0 impostorscore=0 bulkscore=0 phishscore=0 mlxscore=0 adultscore=0 mlxlogscore=660 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003260146 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org spin_until_cond() will wait until nmi_ipi_busy == false, and nmi_ipi_lock_start() does not seem to change nmi_ipi_busy, so there is no way this while will ever repeat. Replace this 'while' by an 'if', so it does not look like it can repeat. Signed-off-by: Leonardo Bras --- arch/powerpc/kernel/smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index ea6adbf6a221..7c904d6fb4d2 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c @@ -473,7 +473,7 @@ static int __smp_send_nmi_ipi(int cpu, void (*fn)(struct pt_regs *), return 0; nmi_ipi_lock_start(&flags); - while (nmi_ipi_busy) { + if (nmi_ipi_busy) { nmi_ipi_unlock_end(&flags); spin_until_cond(!nmi_ipi_busy); nmi_ipi_lock_start(&flags); -- 2.24.1