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]
Message-ID: <tip-76f290935b1a395ee6c9a14697f16593591d1fe8@git.kernel.org>
Date:   Thu, 1 Dec 2016 16:10:58 -0800
From:   tip-bot for Sebastian Andrzej Siewior <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     tglx@...utronix.de, vbabka@...e.cz, hpa@...or.com,
        mingo@...nel.org, linux-kernel@...r.kernel.org, hannes@...xchg.org,
        mhocko@...e.com, akpm@...ux-foundation.org, bigeasy@...utronix.de,
        mgorman@...hsingularity.net
Subject: [tip:smp/hotplug] mm/vmstat: Drop get_online_cpus() from
 init_cpu_node_state/vmstat_cpu_dead()

Commit-ID:  76f290935b1a395ee6c9a14697f16593591d1fe8
Gitweb:     http://git.kernel.org/tip/76f290935b1a395ee6c9a14697f16593591d1fe8
Author:     Sebastian Andrzej Siewior <bigeasy@...utronix.de>
AuthorDate: Sun, 27 Nov 2016 00:13:35 +0100
Committer:  Thomas Gleixner <tglx@...utronix.de>
CommitDate: Fri, 2 Dec 2016 00:52:35 +0100

mm/vmstat: Drop get_online_cpus() from init_cpu_node_state/vmstat_cpu_dead()

Both functions are called with protection against cpu hotplug already so
*_online_cpus() could be dropped.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Acked-by: Michal Hocko <mhocko@...e.com>
Cc: linux-mm@...ck.org
Cc: rt@...utronix.de
Cc: Johannes Weiner <hannes@...xchg.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Mel Gorman <mgorman@...hsingularity.net>
Cc: Vlastimil Babka <vbabka@...e.cz>
Link: http://lkml.kernel.org/r/20161126231350.10321-8-bigeasy@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>

---
 mm/vmstat.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/mm/vmstat.c b/mm/vmstat.c
index 604f26a..0b63ffb 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -1722,24 +1722,19 @@ static void __init init_cpu_node_state(void)
 {
 	int cpu;
 
-	get_online_cpus();
 	for_each_online_cpu(cpu)
 		node_set_state(cpu_to_node(cpu), N_CPU);
-	put_online_cpus();
 }
 
 static void vmstat_cpu_dead(int node)
 {
 	int cpu;
 
-	get_online_cpus();
 	for_each_online_cpu(cpu)
 		if (cpu_to_node(cpu) == node)
-			goto end;
+			return;
 
 	node_clear_state(node, N_CPU);
-end:
-	put_online_cpus();
 }
 
 /*

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ