linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: linux-kernel@vger.kernel.org
Cc: rt@linutronix.de, tglx@linutronix.de,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	Mel Gorman <mgorman@techsingularity.net>,
	Johannes Weiner <hannes@cmpxchg.org>,
	linux-mm@kvack.org
Subject: [PATCH 07/22] mm/vmstat: Drop get_online_cpus() from init_cpu_node_state/vmstat_cpu_dead()
Date: Sun, 27 Nov 2016 00:13:35 +0100	[thread overview]
Message-ID: <20161126231350.10321-8-bigeasy@linutronix.de> (raw)
In-Reply-To: <20161126231350.10321-1-bigeasy@linutronix.de>

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

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: linux-mm@kvack.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 mm/vmstat.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/mm/vmstat.c b/mm/vmstat.c
index 604f26a4f696..0b63ffb5c407 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();
 }
 
 /*
-- 
2.10.2

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

       reply	other threads:[~2016-11-26 23:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20161126231350.10321-1-bigeasy@linutronix.de>
2016-11-26 23:13 ` Sebastian Andrzej Siewior [this message]
2016-11-28  9:24   ` [PATCH 07/22] mm/vmstat: Drop get_online_cpus() from init_cpu_node_state/vmstat_cpu_dead() Michal Hocko
2016-11-26 23:13 ` [PATCH 08/22] mm/vmstat: Avoid on each online CPU loops Sebastian Andrzej Siewior
2016-11-28  9:28   ` Michal Hocko
2016-11-29 14:08     ` Thomas Gleixner
2016-11-29 14:44       ` Michal Hocko
2016-11-29 14:51       ` [PATCH 08/22 v2] " Sebastian Andrzej Siewior
2016-11-29 15:20         ` Michal Hocko
2016-11-26 23:13 ` [PATCH 09/22] mm/vmstat: Convert to hotplug state machine Sebastian Andrzej Siewior
2016-11-29 14:52   ` [PATCH 09/22 v2] " Sebastian Andrzej Siewior
2016-11-26 23:13 ` [PATCH 10/22] mm/zsmalloc: " Sebastian Andrzej Siewior
2016-11-26 23:13 ` [PATCH 11/22] mm/zswap: Convert dst-mem " Sebastian Andrzej Siewior
2016-11-26 23:13 ` [PATCH 12/22] mm/zswap: Convert pool " Sebastian Andrzej Siewior
2016-11-26 23:13 ` [PATCH 14/22] mm/compaction: Convert " Sebastian Andrzej Siewior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161126231350.10321-8-bigeasy@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=rt@linutronix.de \
    --cc=tglx@linutronix.de \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).