Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3199393pxb; Mon, 24 Jan 2022 04:49:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJzKEdUHdXiAuQo2jD1c8ocGRh+zdstdyCp/6hlF8Df3/+O/54jQmsqfiIu33Us5MHE+qR0Y X-Received: by 2002:a63:b10d:: with SMTP id r13mr11750549pgf.257.1643028559269; Mon, 24 Jan 2022 04:49:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643028559; cv=none; d=google.com; s=arc-20160816; b=QHzZ7G4o57r8nta57WLy2p5mw7wdAJvPEsC46sRdclWMnW3p/Xe8lrZ4HXTETV8kMQ PiZUOtHTmD19hNDxpA8jfJnOtK2qfPElDnEqNg10UFdFihCOdnZ9jWAIJrp+rQiFTyHb niCStMASIV1yUKOlevTQEZvnbZonNuC1iWl8Rr5lLKOCXjpdM1sKf46lN3Uauy1LOSBx nAF5S/3YYdvCoiyKI9SkXOMOw/e28GY+Pe3a7iaTMn0ZmNfS8xrohgFFBXoirwXj9pmV HFWKlwVKRVUy5IzlyLILSh7LcNqXFpO0FfkQ3kDzvP/SfB8EksDG0KKzTy9FqWoG8R6b v84Q== 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=Hn/0KEFQM0VohxFbDN7o+rKVell2I9YQDMnO10ziuwg=; b=tKrXcb9ycPjqrgnQnwkeUH2MFePZB0ULUhMS7ZJVeNuRMfc1JNWbx/njWIL4Cf472V hptJ75UzyKqWqhSlz8peyyj6d4E5gmZ68qOUPZ52KaMRjglhqxcgHtCR4JXjqCtQMRWL 4AyvDLJ3M6yDUn+HJe7KDCGOQOutQCV+oFTfKgQEhn/J/5MG1t5wj/7me+h8NXYpPBOg WFSfnXPvyUtWxi7C4YEEUmjtITkuLjaSFRptCWC9SLtWrQx3WBwhznvKuxu3GjOhyoCN U6ON7uYljfRLop+xkhRD6UfZOswfN9cBmIA8kHzH1N9c3bmvb7ms/TGaHnPr7S00b9JS nq0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=RLWSVVHh; 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 c7si13336958pgq.295.2022.01.24.04.48.46; Mon, 24 Jan 2022 04:49:19 -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=RLWSVVHh; 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 S240476AbiAWSnm (ORCPT + 99 others); Sun, 23 Jan 2022 13:43:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240176AbiAWSm0 (ORCPT ); Sun, 23 Jan 2022 13:42:26 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB8A6C06178C; Sun, 23 Jan 2022 10:42:25 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id h12so14115127pjq.3; Sun, 23 Jan 2022 10:42:25 -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=Hn/0KEFQM0VohxFbDN7o+rKVell2I9YQDMnO10ziuwg=; b=RLWSVVHhK5sS0VJoSJh5qzr3kvxFKZMIuqha6nZABD5yiUFV891TsT6pr+BuRKkmau Jr3NQlJfn60hdMW9oRHukDxgvDsry86rj7D7fDQ8hAMfFCHdYoGZ3xOOJS3VxiMXiCQN WnJ2HgK8tLMAJO17kJRpJTZd8jvdJSm4IT9rLQFWHGLA0yOqUkzDIoW/kt5NFH+HADLb 2tR+oOK30YBZYNgEdS7t6hR2kTpNLr7opXgJIUR7uT0EagLXFCDKhdsJMzGULlhJQXBq ZXbfYZZn9gq9VNQqPhfrLOtLeJu+QgAk81hoKa+JbgquZkSqgiXO36WP2fNwoKI4MuU2 KYWg== 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=Hn/0KEFQM0VohxFbDN7o+rKVell2I9YQDMnO10ziuwg=; b=MSgXdiFbGidJlosx3rJr7JXboPggUaQHjtMgqcsl7i6senjOutUDPb9oBHxo+6JgIQ H11FbGozgpng2VkNraxPovYXwoYvNSkW7GdB3qghaBKp+seZu2QysfrlYOsnbN5gBD+Z uebO/kyX55F2cQFtAQQ/4MJgw8HjhN4DCv+DziRRfxSycp54DPOqM/a7u0bzYe2dsrsU leZ5ARobQchDk8y9nSc4u5kDwr+e1LxCH9UFx9AgppBzNXAOxrxBtrytfBg0p13gE1UO Fxh9EnloBvgd7BmsDqUjOZeFjXp7lj0W4OejHPyO3hmBG85JksGB/37WGlEl0Kfk1m/H VEWw== X-Gm-Message-State: AOAM531ZkzSLhilAQgoHg8Z6fs5zCzqzqZmrxFXqvN1oZDOvTynwNqw6 50MnPZN3wDXZauCRO7Bi1/T6LhPNV78= X-Received: by 2002:a17:902:9a83:b0:14a:a893:f7ff with SMTP id w3-20020a1709029a8300b0014aa893f7ffmr11718191plp.6.1642963345210; Sun, 23 Jan 2022 10:42:25 -0800 (PST) Received: from localhost (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id ck21sm10634905pjb.51.2022.01.23.10.42.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 10:42:24 -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, "Rafael J. Wysocki" , Len Brown , Dan Williams , Huacai Chen , Vitaly Kuznetsov , Alison Schofield , linux-acpi@vger.kernel.org Subject: [PATCH 50/54] acpi: replace nodes__weight with nodes_weight_ge for numa Date: Sun, 23 Jan 2022 10:39:21 -0800 Message-Id: <20220123183925.1052919-51-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 acpi_map_pxm_to_node() calls nodes_weight() to compare the weight of nodemask with a given number. We can do it more efficiently with nodes_weight_eq() because conditional nodes_weight may stop traversing the nodemask earlier, as soon as condition is met. Signed-off-by: Yury Norov --- drivers/acpi/numa/srat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c index 3b818ab186be..fe7a7996f553 100644 --- a/drivers/acpi/numa/srat.c +++ b/drivers/acpi/numa/srat.c @@ -67,7 +67,7 @@ int acpi_map_pxm_to_node(int pxm) node = pxm_to_node_map[pxm]; if (node == NUMA_NO_NODE) { - if (nodes_weight(nodes_found_map) >= MAX_NUMNODES) + if (nodes_weight_ge(nodes_found_map, MAX_NUMNODES)) return NUMA_NO_NODE; node = first_unset_node(nodes_found_map); __acpi_map_pxm_to_node(pxm, node); -- 2.30.2