Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3256746pxb; Mon, 24 Jan 2022 06:02:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWFBIAhvLUdLNg0X1ra33PxrnfducTWExbUImHsqkeuQRE7Y+bC1yMP6HPlFsETmKBAMZo X-Received: by 2002:a17:902:c94d:b0:14b:2232:83ba with SMTP id i13-20020a170902c94d00b0014b223283bamr12156277pla.153.1643032970879; Mon, 24 Jan 2022 06:02:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1643032970; cv=pass; d=google.com; s=arc-20160816; b=NXHWVPddFPfm3FSdHw0IpFj2fOX4aWAoqFroR9mPQ/porY4aS6cG1vBFZD91Kl/jhQ L7ABtrZ/f223g0sohKNhe1ziRMu3gHE/wWwjXpRG2zze3hSSgavfi0Lyr/+w/iB8MGNB M4zP79IT6QWTNDf7lZxIcKKYIf+keNzTYrKMfal57piwKGYI+dNSP4aCne6IPr+90eaM l6PT7OAxAPMjQ1o/diiq3L+RWv8I0McITwN8LufZUtQvcfvPR4wyEE7XEGsLDzjwJlVY ZeHSSqezpFPMpzbzvs+d372ODf6RTBwUN4oHgFVS+TXAe5k3NyRffZnzW00cbopT0oGd 7izQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :msip_labels:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:to:from :dkim-signature; bh=wTTA3TYawVIIlVINYsewsKqMNU2XcOBfcKBpYbj7TBA=; b=ex119dSL/hrxSHSRXgldJvjcWeAZRQ81TI+jJg8fsbjKdsAlmJJwAmDm+YmR0iyKn+ gb/fs2tlSews8Vvju1NQM9h0NSPOjjtDm/TR/MYBJ1BMN/+yikIkKk3AW87P4tOt3uuP /WqQ/h0FDbTEmFiJeyFxJxerPKQFW/jw0QbOKs1tumhL/R5C81Zu0eexGO22p78bJGXX 67js8Qp56fpeyNjYN1vtJl3PQwcwngEeQN7KW+wJguzxFRMfjazOgIincswMMBM1vJcc lnfelbdKqvXZd0CUmbWJFIKCI6v1wRD0yL164jEiZ/f5oWNWrsCuqIB2LhKwDd8fsCjw Yzug== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=F2U+oLzH; arc=pass (i=1); 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j190si6061258pge.659.2022.01.24.06.02.37; Mon, 24 Jan 2022 06:02: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=@microsoft.com header.s=selector2 header.b=F2U+oLzH; arc=pass (i=1); 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240283AbiAWWCO (ORCPT + 99 others); Sun, 23 Jan 2022 17:02:14 -0500 Received: from mail-eus2azon11021022.outbound.protection.outlook.com ([52.101.57.22]:39991 "EHLO na01-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234697AbiAWWCN (ORCPT ); Sun, 23 Jan 2022 17:02:13 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YcwdRVr0vjzJLCqjEDYaZY4rqh9rNwPmIxHXSManxsOP9x1LxElXjRYVC9ULvo0ql9aCvMCboGR/9zPQVG6jadr9kaqSIhZJSu2z+16ZsKFHv1JzV5qfeWUpYo/EPY6XESSmF2XY+B43lcSg2giPwpixvFy0xESNv5UA7V4SxZ3LWDQ7OM1Et4Hkh4qQRQIjXUXIgpGebvypQJ3qcoO5lvqKJ5gJD+50VvHRrKqOdOJg89y1Lrc8TG6q9F4yeiL51lqG9RjHhKgJbJBiNzoHbR8QAtBp7417LEGoGLOvuDbtoSdS3S3Cww6s61LowsbXNSh856ULwrMo4hSGLlIrbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wTTA3TYawVIIlVINYsewsKqMNU2XcOBfcKBpYbj7TBA=; b=kbgdQF3A/+G7UWBl1loEPglCB5lw6sTc4rGNHqEtWM8YdjapYjB5LDbfb6tACPY35j3FylvV7xr65SLz/6C3RY2KBbInDBBoMLXfKTe6qe3xPXOgNmbA09KItOeJhTaJsPE/DAE2wfNjqgYDA/yH/lxK0NKa84EeR4IZeciHmAzqVfgMb0V/nE9n3YI9khdYQ+mAtm+73/38YgOua8+wzDQZ7ZxQqqv0Kv3zReEqGtBPbfLwSm7vZ0CB8v9UK0LNXyXx41gRWfr6sjGQxbAmUt0NTqT2qqPs1Q5z4dERZddQ2kHyvRDJe4EdcKR3I6tudEVJAwylebELMZQShCV4Dw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wTTA3TYawVIIlVINYsewsKqMNU2XcOBfcKBpYbj7TBA=; b=F2U+oLzHjbgKskd36V+18KyWNl3a93VNdQXGzttboMvspki+rhturCsVA4IiEiAvQcbk8L4YhkTZfXL/2/dk3vmbISq7QHQSHvKeRXrcYBl2WmFhKEWbzHZIanaa0VSF6ShTsRE2gHGFA6beKKgdFM+WeVenJ/SIyvZXi9jQnko= Received: from MN2PR21MB1295.namprd21.prod.outlook.com (2603:10b6:208:3e::25) by SJ0PR21MB1999.namprd21.prod.outlook.com (2603:10b6:a03:299::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.7; Sun, 23 Jan 2022 22:02:09 +0000 Received: from MN2PR21MB1295.namprd21.prod.outlook.com ([fe80::d1ac:adcd:9b00:28fc]) by MN2PR21MB1295.namprd21.prod.outlook.com ([fe80::d1ac:adcd:9b00:28fc%8]) with mapi id 15.20.4909.004; Sun, 23 Jan 2022 22:02:09 +0000 From: Haiyang Zhang To: Yury Norov , Andy Shevchenko , Rasmus Villemoes , Andrew Morton , =?iso-8859-2?Q?Micha=B3_Miros=B3aw?= , 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" , KY Srinivasan , Stephen Hemminger , Wei Liu , Dexuan Cui , "linux-hyperv@vger.kernel.org" Subject: RE: [PATCH 43/54] drivers/hv: replace cpumask_weight with cpumask_weight_eq Thread-Topic: [PATCH 43/54] drivers/hv: replace cpumask_weight with cpumask_weight_eq Thread-Index: AQHYEIjseMEfWodowkK36SzktkggO6xxKAqg Date: Sun, 23 Jan 2022 22:02:09 +0000 Message-ID: References: <20220123183925.1052919-1-yury.norov@gmail.com> <20220123183925.1052919-44-yury.norov@gmail.com> In-Reply-To: <20220123183925.1052919-44-yury.norov@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=4119fcae-a908-4af5-bb81-945771b82db6;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2022-01-23T21:59:54Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 28965adb-ef8a-4ffc-a93a-08d9debc00ac x-ms-traffictypediagnostic: SJ0PR21MB1999:EE_ x-ms-exchange-atpmessageproperties: SA|SL x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 0rPFrixneQS1Y0ym7D3Um09h0kMJXgD66YPlwS0QVKp3Kg6uOkCSh/4mtigWtjWPwwd0d6Airib8SHNd1eYpmChYfwfsULJUf8cD8IBNcytghJBkWtxM4RrJ8LpE1Ahd9mlwV+ZCKJOqw+S+NmBe6Es12BdQAWYEZfurH7PcOGd0y+aEE1EE6NytY1qcdrxtaUXufWvA2HqqS+PINmcmhqtMEYPSUKj7WGnI763/ji3eymnEOR8G6vxxvjIiaRM5tSrYW/0oTKeSaLDoYBirIRq8cDM/UJTheYjzX/ekC26YgMQ2c0cNUEVw8/Nu+ycgBqn5dWYoUtRevXX7HnH7po2aeyfwecv4GE6KcpUJPms7oWpFT21ZJuMTp3yqw9jn0ew7g8SopmSdl3ARHPymxdZK1sDJGOwCLb9SaUZTylRXdxEbFyhsbEIBQ2g+hltxHNi3DlVQikk+VWxD7Z6RQs+bElfaxRUdZCOU+Q1o8JrD4jZyy0lqMdSsxyzxvS4kV9f9AXdRg+yLhWadu+y9PIevdp+JxpA++1Uv7Un++l25ROcv28uWMuz9JURTqoKKrJ9sUjDjpOciyNvFptugIQqzIH5/jqWPOw7GmbGVDyt3sgqL0u3e5rJ2PmtgRl5VX6aJU/oHzr8fBHj+9oajKwl6wjv096inRAf9uGLid3Myxlz1glrySOaDbLBgy4wa9Y4v86pEK9Qfa42/7AI0CVSdePd09m7Gm2YLxYNGfbRUMQNXac0w5BqAwk1bxJuHqHpLgJqaXw4gXkhX7dG4Muue4FdeFawITSZQFply5Ng= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR21MB1295.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(110136005)(921005)(316002)(38070700005)(83380400001)(82950400001)(82960400001)(26005)(76116006)(186003)(38100700002)(7416002)(66556008)(8676002)(2906002)(9686003)(8936002)(52536014)(55016003)(86362001)(66446008)(8990500004)(6506007)(53546011)(33656002)(71200400001)(66946007)(5660300002)(7696005)(10290500003)(508600001)(66476007)(64756008)(122000001)(16393002)(20210929001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-2?Q?J7TM2GxxQeKoTaHmR1O9ixgicfilw9rZHmDnYkwyg4KlQY0DzBFwTBqCS5?= =?iso-8859-2?Q?XilsA19vhC4dsrBNv1JxDGoX0URcHF5FGT01EpAP9d99h7e5H/fO/QsypV?= =?iso-8859-2?Q?hWAwXAwc4V8HE32935PQ4kCulAjUlAzxDf05H/E9rXthtt7wTfEXFb+NOB?= =?iso-8859-2?Q?sZ2JyDhn9iO3AuvQOz4fl13jE5ofAUs0q1F+QqNEbsIuynvvaNxcQVQgoh?= =?iso-8859-2?Q?rrPArFPabEy/N9WLuM19HSnvEU3p1PnBlydB95SnGi0Xsh0HaglxGSujkx?= =?iso-8859-2?Q?kBshDR8xjq+ddtVtRH4CR3LFwv7NyLn/0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p9/ntcrApNQmrgqPjpMIvVylJjS6L1O3GWnSplbQKFGow5zUupORQXKF?= =?iso-8859-2?Q?KMM8vJuln9SkHXr7GrYqA9TzUWefPmhIaM6MeqIqwacGcWMsHF5wcI+5RC?= =?iso-8859-2?Q?3uELUIRUy1zxgd/fQnZvjaQzrTBk74x3rGBeYumzW14S6TQAEeWVN/dQ1J?= =?iso-8859-2?Q?ThxRWgKD/Cm0+dA9S51/ya5Z7IFIEPnVPCcuk7ppc6ECCuQ1QzTBn3ZPpV?= =?iso-8859-2?Q?CmRV5BvymKBlOjpHWDH3UEsjYki7qt4pmio3iCOsABnLTjUmydcppLAkJ6?= =?iso-8859-2?Q?O+wX4zw2YQTA22vGRMhMcH9AV72CtHr44jC87vuyfift+VIIu2L1YN4/mH?= =?iso-8859-2?Q?7AhRwR4ecaLNUZVIEj1nspPbgwhlyiXhCqbkuTHxI8GKlNJbFLucieVPRQ?= =?iso-8859-2?Q?3DWsKU1aYGs4QdTCrx3i6qnhFuAZqfTBXmYGG4577aamZs4NO3+xuEtg?= =?iso-8859-2?Q?=3D=3D?= Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR21MB1295.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 28965adb-ef8a-4ffc-a93a-08d9debc00ac X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jan 2022 22:02:09.4269 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: f8/DrsV77PqlQv65XetkBIfENf8Lwl072yZ8RdyLIZ3UV/cO7sb9glVRPyw76Zg/31fOIyP6uPTRggOXlnJQVQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR21MB1999 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Yury Norov > Sent: Sunday, January 23, 2022 1:39 PM > To: Yury Norov ; Andy Shevchenko ; > Rasmus Villemoes ; Andrew Morton ; > Micha=B3 Miros=B3aw ; 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; KY Srin= ivasan > ; Haiyang Zhang ; Stephen Hemm= inger > ; Wei Liu ; Dexuan Cui ; > linux-hyperv@vger.kernel.org > Subject: [PATCH 43/54] drivers/hv: replace cpumask_weight with cpumask_we= ight_eq >=20 > 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. >=20 > Signed-off-by: Yury Norov > --- > drivers/hv/channel_mgmt.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > 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 *chann= el) > } > alloced_mask =3D &hv_context.hv_numa_map[numa_node]; >=20 > - if (cpumask_weight(alloced_mask) =3D=3D > - 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. Thanks. Reviewed-by: Haiyang Zhang