]> Git Repo - linux.git/commitdiff
ACPI: NUMA: Optimize the check for the availability of node values
authorYuntao Wang <[email protected]>
Wed, 6 Dec 2023 10:43:17 +0000 (18:43 +0800)
committerRafael J. Wysocki <[email protected]>
Tue, 12 Dec 2023 19:36:18 +0000 (20:36 +0100)
The first_unset_node() function returns the first unused node in
nodes_found_map. If all nodes are in use, the function returns
MAX_NUMNODES.

Use this return value to determine whether there are any available node
values in nodes_found_map, eliminating the need to use nodes_weight()
for this purpose.

Signed-off-by: Yuntao Wang <[email protected]>
[ rjw: Changelog edits ]
Signed-off-by: Rafael J. Wysocki <[email protected]>
drivers/acpi/numa/srat.c

index 9d2d0deb256e072583c2046bf05b99d31e234769..d58e5ef424f2817f66d4243a754db080a1ce470b 100644 (file)
@@ -67,9 +67,9 @@ 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)
-                       return NUMA_NO_NODE;
                node = first_unset_node(nodes_found_map);
+               if (node >= MAX_NUMNODES)
+                       return NUMA_NO_NODE;
                __acpi_map_pxm_to_node(pxm, node);
                node_set(node, nodes_found_map);
        }
This page took 0.056757 seconds and 4 git commands to generate.