Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3174230pxb; Mon, 24 Jan 2022 04:13:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJw56MrkX7wNtX5N8C0iUqlRD7TihZ1cj5co2qdiwzxrBIuZRAbgdI0cMwK1bKUVuRT38Mxx X-Received: by 2002:a17:903:41c9:b0:14b:53f9:b4fa with SMTP id u9-20020a17090341c900b0014b53f9b4famr3762800ple.166.1643026398231; Mon, 24 Jan 2022 04:13:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643026398; cv=none; d=google.com; s=arc-20160816; b=L4BPJVoQyfsIA3Zt/zwnKFdFxD2ymFKaeUs2DvaHFSrM32oQfOB2PEUtf27zs0D1Ar pmTp9c5hpSSorElGUNU9BIF2r/yAMHPljF7AoNFLMXKbQWS0mK8a1P2rfOpmT54a7+zA eZJkupSjNOlZugKqoVojFAkJnerBfiwhbWtjzv4DxRZJF+C4URoQRdGcFDSs+gTtCgs6 J/yBsTdCild1VtISmDJ7NP4u/nMtPGTL6DDMw6ZszMM5R6C78D9fwkY6ePBF5/5oZxAX rr8g90XD64Ifa0f9lnG+W+LyH5SrwRGYcSu+1m+xnQt/XcLUpUKrZGxKVr3e/iZOAvcU Yt/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=EaZo6YWz+PE4Amu8QukF1Cw8oSIakZDIQiKoGR/62wY=; b=FAofnZvQOv3nmcfXmDifxrArE5UWfXkCy6+K1xlPDYz5Jg9wV2tmOwqDIZDVNVRdJO 82jswFtHku1jR3f2DwQ74Cqg+ODM/YYHyCW80UXomQCr97IO3mL6xmAk/iNgfXa4o1M3 t+QsrX9UfeSt9YaeD63tbOoOJeaYJXHt+ayQmxToPzKzjTGsANnnGa8yjhWfp7xb0F3l U7Z8WBHIuIRucAqI6bxFS0WPQ/vJbAZPqFkxrGmQIs1+cT2jQ36L7cMLwCcIHmeTiXlu WH7V+qoCMn1i3cdBeSCMJAcKGxB42Za3iOQz1fzVehujvKUhtdTyCxpZD6wcOVdxY28i CTYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=V2jPEDWq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t19si14612522pgu.774.2022.01.24.04.13.06; Mon, 24 Jan 2022 04:13:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=V2jPEDWq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239791AbiAWSkv (ORCPT + 99 others); Sun, 23 Jan 2022 13:40:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239780AbiAWSkg (ORCPT ); Sun, 23 Jan 2022 13:40:36 -0500 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBFEEC06173B; Sun, 23 Jan 2022 10:40:29 -0800 (PST) Received: by mail-pg1-x534.google.com with SMTP id f8so13142887pgf.8; Sun, 23 Jan 2022 10:40:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=EaZo6YWz+PE4Amu8QukF1Cw8oSIakZDIQiKoGR/62wY=; b=V2jPEDWq3IwIGuJgkDE35gcjcxe2X2oRT+W5/8zZD364JRtYsD/NetC+jPipdlP248 VCZINxrgU8tohaAr/uOO2w7qtXxaF4tnonr9b/tMDnGy8/JWEsbHewV6ABBhs9UVYadY ZRHqPkouoaRfLkfknvSgvJd3V0Cre7vIvYAmqjqhx7RQhsyXW3ho+RqXj9q9WBKZaFnw 0zGgSRnEyOR8m11UhivzNB8lHiu2vzn+ZubLLiEtRJUlCjBZqg4O7WmF/YhdMkw1DmSN owVHE4zq1o6nHuVmcX62AylgLcK1BDygi77X2PO2ga9uCd6LKSXnMX8BIaj6I1/fkfLo NAtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EaZo6YWz+PE4Amu8QukF1Cw8oSIakZDIQiKoGR/62wY=; b=uBCUNFEZwWUKpj/628Wq+7kN8o08g5iVLv9Kd737PSnl4SsN7tbNasARBXl+usdZnE 8Jo3et3ffhU1GlAyWejJ5VUG4RT4e3EblfLPTZNLYjPSAqrQswAw1A/eHOWgUSGehUEZ AzjkPYflubawOk8p35zyzZ1lRULyoDc7fXQkqCE1tUrK51qMpwj7vMKzKbOHMF9RQ67J 7i+eclm8WWL1MuvY6VUG5AU9K8vckAq38B2pa7O8A9z7/pgF3wAHxKJN2PLCcLsNXTqa 30bO1sdRfP2Z2LWvuTOt1uWWu9C9+v3vLg2xs9xbXRgvQ5aNBYypNJPeMoGrcufV+oWE q7Tg== X-Gm-Message-State: AOAM532WQs9YN6rKVqNAEMWx9rUZMPOV8qZgrEH6zFSflRd61buWe0Yt WlGr3Thb8dhwqDR2m0dfTiE= X-Received: by 2002:a63:fe10:: with SMTP id p16mr9366634pgh.546.1642963229253; Sun, 23 Jan 2022 10:40:29 -0800 (PST) Received: from localhost (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id c8sm14350494pfl.122.2022.01.23.10.40.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 10:40:28 -0800 (PST) From: Yury Norov To: Yury Norov , Andy Shevchenko , Rasmus Villemoes , Andrew Morton , =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= , Greg Kroah-Hartman , Peter Zijlstra , David Laight , Joe Perches , Dennis Zhou , Emil Renner Berthing , Nicholas Piggin , Matti Vaittinen , Alexey Klimov , linux-kernel@vger.kernel.org, Richard Henderson , Ivan Kokshaysky , Matt Turner , Geert Uytterhoeven , Davidlohr Bueso , "Russell King (Oracle)" , Kees Cook , Zheng Yongjun , Jens Axboe , linux-alpha@vger.kernel.org Subject: [PATCH 13/54] arch/alpha: replace cpumask_weight with cpumask_empty where appropriate Date: Sun, 23 Jan 2022 10:38:44 -0800 Message-Id: <20220123183925.1052919-14-yury.norov@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220123183925.1052919-1-yury.norov@gmail.com> References: <20220123183925.1052919-1-yury.norov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org common_shutdown_1() calls cpumask_weight() to check if any bit of a given cpumask is set. We can do it more efficiently with cpumask_empty() because cpumask_empty() stops traversing the cpumask as soon as it finds first set bit, while cpumask_weight() counts all bits unconditionally. Signed-off-by: Yury Norov --- arch/alpha/kernel/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c index 5f8527081da9..0d4bc60828bf 100644 --- a/arch/alpha/kernel/process.c +++ b/arch/alpha/kernel/process.c @@ -125,7 +125,7 @@ common_shutdown_1(void *generic_ptr) /* Wait for the secondaries to halt. */ set_cpu_present(boot_cpuid, false); set_cpu_possible(boot_cpuid, false); - while (cpumask_weight(cpu_present_mask)) + while (!cpumask_empty(cpu_present_mask)) barrier(); #endif -- 2.30.2