Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3176227pxb; Mon, 24 Jan 2022 04:15:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxleLjQ73xvtnrC94X6Sj6HfKX4gCU7Dq0tfWxhXAUlkjVpHIlUZnsoFMacdxzKl12cOCe X-Received: by 2002:a63:8c48:: with SMTP id q8mr11946242pgn.490.1643026549117; Mon, 24 Jan 2022 04:15:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643026549; cv=none; d=google.com; s=arc-20160816; b=hqtSEu/F3JAf5HawatVjS5PA9tf1kdTzzpMJZ7y00vR6jGrNZtkBFP6fi6KDN3AWxF 2DQfEPGUn5kz1Qudlb+7f+vcSiNiZGvYDRpLoOWIgXXUDkNokb1vTIW5mCZl4jo397Kt gu4vDf0W400fAO0Ex7nLalNSnT5fweTTsjsx9ydSRNcaohI2Vl8d2LpMdHShs7g3Q0t+ RUwxR+UVWwGCHY9I9T7Pp5IB6I3GFT7PpS4SKWL9fxG+K0DsNEtJxMX4IqO2SuSSiR4+ h1HMSAn5gwKm/n6SrTSFWJPInV9RXJ3c6v9o81c6LJvhh5lN5LpeDO5I85rN/XTmh0kb HA1w== 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=I0YT/VYh6ObjnXDB7ng030sn8u8S3AAW+xjtpU6qhC0=; b=ldBPncEacQup+N2Gxpox/9frg6XxShIk976/mRbAB3a3KJxdODJV8KMgB/bmLvw4RS v1zrU83uOpie6KWqiPZM0LTrX2jmdmwJSaAYLF6F4NslRcv+6VVRBjQEEZFBxB27EBer +pmY9D4iTXFv4MfF0DDxx8k96Q7n9TieT0i85upsQMkFEhFuFOlOV08p+Ih48f0bnLJ7 mgh8lmC4qbuC4d6jprYQRgYTK4UOPG+yC0+gRbLN8Q+77++mX9m0r2LD+2+2HALUjTZv JcDKfc+rE3oFafwyMSyKPnrpnzlyX5lqysr+2RojloOblRc6jY70VkfgL3BxMNGOWApy 4yEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kq3s29g6; 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 u184si2416839pgd.569.2022.01.24.04.15.37; Mon, 24 Jan 2022 04:15:49 -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=kq3s29g6; 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 S240290AbiAWSnI (ORCPT + 99 others); Sun, 23 Jan 2022 13:43:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239935AbiAWSmD (ORCPT ); Sun, 23 Jan 2022 13:42:03 -0500 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4C36C061782; Sun, 23 Jan 2022 10:42:03 -0800 (PST) Received: by mail-pg1-x52c.google.com with SMTP id v3so7875037pgc.1; Sun, 23 Jan 2022 10:42:03 -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=I0YT/VYh6ObjnXDB7ng030sn8u8S3AAW+xjtpU6qhC0=; b=kq3s29g6GZf8wi2NbTnwwMbHhy8TpKIQ4eWUy/tjlH1Vpe8OzRohSKbh0NJuBIbGKE AWefAIJHW1zxeanlvYSDuErwI7AbVCYWnyZSnLyC+yOjjk1falLUifpAOyQfzPGRxlUm NCgGGZw6YahfLJMTHbzfLum4x9VUdar9NvF4YR9uJAjsjgdICCc9bGMYTiw6dhVpIj2m 23T3yJQuFspBrGVljLlEbWLX8Hn44/lP19MFqTTsAIGZ+9GmI5K/C2rnUrTkmWn1r5Uj u7qZ1u+B53jjHd5jQ0n+p5ZGLFrBDziDkFTOYlcCINLApK7NL2aC6acKb3gscVOqbn1P UI2A== 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=I0YT/VYh6ObjnXDB7ng030sn8u8S3AAW+xjtpU6qhC0=; b=KQcivrMrVE+hnVKq6JgrLyf0R2yo2tRKtKlOv+8RnMyCwrEtbwcz5K1rANwYnPw7/m 2m9CA/tmWLP/G20xdQlMLCsFb6EBjFf1JkhsmLiCfZmJ8NK5vxpdn9PqusIYHQ+skeCj r1NPCeNE67DVxPKCojmCjHS4okey9Ezz26YAx15Chwh4bRWV6Njz9mXXrY34QgmPtFZy 3F2Wg+Cm7ULySXflXNcrlcANhBdrGPxZY0qxtEqlZ2k9qPU9u55j2EiIAx4ilaMNVp5z tLn0O2ZFX4gkUNyln9cEGYU+L4ARjaaGF2mR/a5EOCXqvdppfOUQJWWvPveBc/TtPwy3 pQPA== X-Gm-Message-State: AOAM5332ttlwrbU/+MhPJxix/8L9FnmMWxP0t+dgs9p3gNrT1SHAd9TZ dT5vcoeiuO/Jq/IAsFieujc= X-Received: by 2002:a05:6a00:1995:b0:4c5:eb10:c83d with SMTP id d21-20020a056a00199500b004c5eb10c83dmr11135520pfl.70.1642963323151; Sun, 23 Jan 2022 10:42:03 -0800 (PST) Received: from localhost (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id h14sm14431432pfh.95.2022.01.23.10.42.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 10:42:02 -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, "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , linux-hyperv@vger.kernel.org Subject: [PATCH 43/54] drivers/hv: replace cpumask_weight with cpumask_weight_eq Date: Sun, 23 Jan 2022 10:39:14 -0800 Message-Id: <20220123183925.1052919-44-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 init_vp_index() calls cpumask_weight() to compare the weights of cpumasks We can do it more efficiently with cpumask_weight_eq because conditional cpumask_weight may stop traversing the cpumask earlier (at least one), as soon as condition is met. Signed-off-by: Yury Norov --- drivers/hv/channel_mgmt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 60375879612f..7420a5fd47b5 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -762,8 +762,8 @@ static void init_vp_index(struct vmbus_channel *channel) } alloced_mask = &hv_context.hv_numa_map[numa_node]; - if (cpumask_weight(alloced_mask) == - cpumask_weight(cpumask_of_node(numa_node))) { + if (cpumask_weight_eq(alloced_mask, + cpumask_weight(cpumask_of_node(numa_node)))) { /* * We have cycled through all the CPUs in the node; * reset the alloced map. -- 2.30.2