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-next>] [day] [month] [year] [list]
Message-Id: <20220302011433.2054613-1-lv.ruyi@zte.com.cn>
Date:   Wed,  2 Mar 2022 01:14:33 +0000
From:   cgel.zte@...il.com
To:     mingo@...hat.com
Cc:     juri.lelli@...hat.com, vincent.guittot@...aro.org,
        dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
        mgorman@...e.de, bristot@...hat.com, linux-kernel@...r.kernel.org,
        Lv Ruyi <lv.ruyi@....com.cn>, Zeal Robot <zealci@....com.cn>
Subject: [PATCH] sched/topology: avoid calling synchronize_rcu()

From: Lv Ruyi (CGEL ZTE) <lv.ruyi@....com.cn>

Kfree_rcu() usually results in even simpler code than does
synchronize_rcu() without synchronize_rcu()'s multi-millisecond
latency, so replace synchronize_rcu() with kfree_rcu().

Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Lv Ruyi (CGEL ZTE) <lv.ruyi@....com.cn>
---
 kernel/sched/topology.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index 974212620fa1..0ce302b4d732 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -1970,8 +1970,7 @@ static void sched_reset_numa(void)
 	if (distances || masks) {
 		int i, j;
 
-		synchronize_rcu();
-		kfree(distances);
+		kfree_rcu(distances);
 		for (i = 0; i < nr_levels && masks; i++) {
 			if (!masks[i])
 				continue;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ