From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46997C4167D for ; Tue, 10 May 2022 15:58:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347514AbiEJQBq (ORCPT ); Tue, 10 May 2022 12:01:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347263AbiEJPwL (ORCPT ); Tue, 10 May 2022 11:52:11 -0400 Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76B5527CF4 for ; Tue, 10 May 2022 08:48:14 -0700 (PDT) Received: by mail-qt1-x82e.google.com with SMTP id h3so13813820qtn.4 for ; Tue, 10 May 2022 08:48:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=T2IJO+Pa5M9voLAKUXr0ktIZBj7JUQbqvUsJEPx3GJM=; b=c3IN7lMAFbv4sEP6laSQRowTvSX+G5HVSYHppf0FixY2y1TOg935HHtOG7mdR4VDoe LQ69xKtAOxfnp4jdc3DXQEgPRlFnpm00mdslKhj6m28OSLFLu9jG5au941IQtcxYX9TQ LhiZpqUmNAvT00BdJohSd3u1bbdaE5Qh+pz80eMMUhg7p6IuxcdGsDdMY3jG2dRCpBRt up0C87zFbVNdmfiE5nx6LZJOpflQEsJdkh86x0JFWLqfBZTWAa3OYqW+AanRLvD2B0BC 5N6Hb4J4B1CLqpldSIQVLKJNnVaehyw4jy1VsGrSBIyXrUm1jSbs+db1MZSetK+1f9zS A30w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=T2IJO+Pa5M9voLAKUXr0ktIZBj7JUQbqvUsJEPx3GJM=; b=0QH68RvxuyjdFimXMyhWDT+efAXL1dTJRpXorKAWfNq8lIg1F4AosERw6qQv8kquqW NQVNn+7GVLvWoCYmJBSTLoGX1xHzlLT7vakSGxn62A6ATcDni6lIq7ffwMubwDFaMnRQ zsWn0XhCgqn58GcJhE6XIUOqCTh4S2qxOzbTCvSVHLSOU/Lh2tTQukKSUxdPLEj1K2TS T1lDiP+yKC0xs7FS7A6Iq+7ljVWviRfJzAT4B4juAHu8A8D4jFo2kCK4GNLyuCwNzTyB pIQnDm9v6v2t8d+LdTHquNaR4EMaYEScD2EEn21q57FyiTASBSY0NrpDC37FUgXha9rT pr0Q== X-Gm-Message-State: AOAM5338ixKM7DFcV7KSnICGae5eQnOnFHE/z7mdvPghksV5UvtkTky1 R/gG/43CpaXInadEpxgIcIaD05Oc09/K4g== X-Google-Smtp-Source: ABdhPJz52r13mAcgDBQf1ACM0hZ/J0vco7XnwEomdirN9ZWSxVJnzg675wnJR4aV7S74ZqzB7KnbjA== X-Received: by 2002:ac8:7fd1:0:b0:2f3:dddb:4206 with SMTP id b17-20020ac87fd1000000b002f3dddb4206mr7333570qtk.11.1652197693544; Tue, 10 May 2022 08:48:13 -0700 (PDT) Received: from localhost ([98.242.65.84]) by smtp.gmail.com with ESMTPSA id z7-20020ac875c7000000b002f39b99f6b5sm9242338qtq.79.2022.05.10.08.48.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 May 2022 08:48:13 -0700 (PDT) From: Yury Norov To: Andy Shevchenko , David Laight , Greg Kroah-Hartman , Joe Perches , Julia Lawall , =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= , Nicholas Piggin , Nicolas Palix , Peter Zijlstra , Rasmus Villemoes , Matti Vaittinen , linux-kernel@vger.kernel.org Cc: Yury Norov , Balbir Singh , Boris Ostrovsky , Borislav Petkov , Dave Hansen , "H . Peter Anvin" , Huang Rui , Ingo Molnar , "Paul E . McKenney" , "Rafael J . Wysocki" , Sean Christopherson , Thomas Gleixner , Tim Chen , x86@kernel.org Subject: [PATCH 14/22] x86: smp: use cpumask_weight_eq() in remove_siblinginfo Date: Tue, 10 May 2022 08:47:42 -0700 Message-Id: <20220510154750.212913-15-yury.norov@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220510154750.212913-1-yury.norov@gmail.com> References: <20220510154750.212913-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 cpumask_weight_eq() is more efficient because it may stop traversing cpumask depending on condition. CC: Balbir Singh CC: Boris Ostrovsky CC: Borislav Petkov CC: Dave Hansen CC: H. Peter Anvin CC: Huang Rui CC: Ingo Molnar CC: Paul E. McKenney CC: Peter Zijlstra CC: Rafael J. Wysocki CC: Sean Christopherson CC: Thomas Gleixner CC: Tim Chen CC: x86@kernel.org CC: linux-kernel@vger.kernel.org Signed-off-by: Yury Norov --- arch/x86/kernel/smpboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 7d948f79ef31..74ca98b3ab2a 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -1621,7 +1621,7 @@ static void remove_siblinginfo(int cpu) for_each_cpu(sibling, topology_sibling_cpumask(cpu)) { cpumask_clear_cpu(cpu, topology_sibling_cpumask(sibling)); - if (cpumask_weight(topology_sibling_cpumask(sibling)) == 1) + if (cpumask_weight_eq(topology_sibling_cpumask(sibling), 1)) cpu_data(sibling).smt_active = false; } -- 2.32.0