Linux-mm Archive on lore.kernel.org
 help / color / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-kernel@vger.kernel.org, rt@linutronix.de,
	tglx@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: Re: [PATCH 07/22] mm/vmstat: Drop get_online_cpus() from init_cpu_node_state/vmstat_cpu_dead()
Date: Mon, 28 Nov 2016 10:24:17 +0100
Message-ID: <20161128092415.GB14835@dhcp22.suse.cz> (raw)
In-Reply-To: <20161126231350.10321-8-bigeasy@linutronix.de>

On Sun 27-11-16 00:13:35, Sebastian Andrzej Siewior wrote:
> 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>

Acked-by: Michal Hocko <mhocko@suse.com>

> ---
>  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>

-- 
Michal Hocko
SUSE Labs

--
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 index

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
2016-11-28  9:24   ` Michal Hocko [this message]
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=20161128092415.GB14835@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=bigeasy@linutronix.de \
    --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

Linux-mm Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mm/0 linux-mm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mm linux-mm/ https://lore.kernel.org/linux-mm \
		linux-mm@kvack.org
	public-inbox-index linux-mm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kvack.linux-mm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git