lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 15 Sep 2023 12:03:29 -0000
From:   "tip-bot2 for Yury Norov" <tip-bot2@...utronix.de>
To:     linux-tip-commits@...r.kernel.org
Cc:     Yury Norov <yury.norov@...il.com>, Ingo Molnar <mingo@...nel.org>,
        Mel Gorman <mgorman@...e.de>, x86@...nel.org,
        linux-kernel@...r.kernel.org
Subject: [tip: sched/core] sched/fair: Fix open-coded numa_nearest_node()

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     d1db9fb432d50b0eecdfdd85d17cc15a59cc093b
Gitweb:        https://git.kernel.org/tip/d1db9fb432d50b0eecdfdd85d17cc15a59cc093b
Author:        Yury Norov <yury.norov@...il.com>
AuthorDate:    Sat, 19 Aug 2023 07:12:34 -07:00
Committer:     Ingo Molnar <mingo@...nel.org>
CommitterDate: Fri, 15 Sep 2023 13:48:10 +02:00

sched/fair: Fix open-coded numa_nearest_node()

task_numa_placement() searches for a nearest node to migrate by calling
for_each_node_state(). Now that we have numa_nearest_node(), switch to
using it.

Signed-off-by: Yury Norov <yury.norov@...il.com>
Signed-off-by: Ingo Molnar <mingo@...nel.org>
Cc: Mel Gorman <mgorman@...e.de>
Link: https://lore.kernel.org/r/20230819141239.287290-3-yury.norov@gmail.com
---
 kernel/sched/fair.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 8dbff6e..41cfd61 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2847,19 +2847,7 @@ static void task_numa_placement(struct task_struct *p)
 	}
 
 	/* Cannot migrate task to CPU-less node */
-	if (max_nid != NUMA_NO_NODE && !node_state(max_nid, N_CPU)) {
-		int near_nid = max_nid;
-		int distance, near_distance = INT_MAX;
-
-		for_each_node_state(nid, N_CPU) {
-			distance = node_distance(max_nid, nid);
-			if (distance < near_distance) {
-				near_nid = nid;
-				near_distance = distance;
-			}
-		}
-		max_nid = near_nid;
-	}
+	max_nid = numa_nearest_node(max_nid, N_CPU);
 
 	if (ng) {
 		numa_group_count_active_nodes(ng);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ