Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1360936 > unrolled thread

[PATCH 1/5] mm: memcontrol: Remove redundant hot plug notifier test.

Started byRichard Cochran <rcochran@linutronix.de>
First post2016-03-18 22:30 +0100
Last post2016-03-21 09:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/5] mm: memcontrol: Remove redundant hot plug notifier test. Richard Cochran <rcochran@linutronix.de> - 2016-03-18 22:30 +0100
    Re: [PATCH 1/5] mm: memcontrol: Remove redundant hot plug notifier  test. Michal Hocko <mhocko@kernel.org> - 2016-03-21 09:20 +0100

#1360936 — [PATCH 1/5] mm: memcontrol: Remove redundant hot plug notifier test.

FromRichard Cochran <rcochran@linutronix.de>
Date2016-03-18 22:30 +0100
Subject[PATCH 1/5] mm: memcontrol: Remove redundant hot plug notifier test.
Message-ID<rea82-C9-7@gated-at.bofh.it>
The test for ONLINE is redundant because the following test for !DEAD
already includes the online case.  This patch removes the superfluous
code.

Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Vladimir Davydov <vdavydov@virtuozzo.com>
Cc: cgroups@vger.kernel.org
Cc: linux-mm@kvack.org
Signed-off-by: Richard Cochran <rcochran@linutronix.de>
---
 mm/memcontrol.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index d06cae2..993a261 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1916,9 +1916,6 @@ static int memcg_cpu_hotplug_callback(struct notifier_block *nb,
 	int cpu = (unsigned long)hcpu;
 	struct memcg_stock_pcp *stock;
 
-	if (action == CPU_ONLINE)
-		return NOTIFY_OK;
-
 	if (action != CPU_DEAD && action != CPU_DEAD_FROZEN)
 		return NOTIFY_OK;
 
-- 
2.1.4

[toc] | [next] | [standalone]


#1361582 — Re: [PATCH 1/5] mm: memcontrol: Remove redundant hot plug notifier test.

FromMichal Hocko <mhocko@kernel.org>
Date2016-03-21 09:20 +0100
SubjectRe: [PATCH 1/5] mm: memcontrol: Remove redundant hot plug notifier test.
Message-ID<rf3ea-2Ra-9@gated-at.bofh.it>
In reply to#1360936
On Fri 18-03-16 22:26:07, Richard Cochran wrote:
> The test for ONLINE is redundant because the following test for !DEAD
> already includes the online case.  This patch removes the superfluous
> code.

The code used to do something specific to CPU_ONLINE in the past but now
it really seems to be pointless and maybe even confusing. All we really
care here is when the cpu goes down and we need to drain per-cpu cached
charges.

> Cc: Johannes Weiner <hannes@cmpxchg.org>
> Cc: Michal Hocko <mhocko@kernel.org>
> Cc: Vladimir Davydov <vdavydov@virtuozzo.com>
> Cc: cgroups@vger.kernel.org
> Cc: linux-mm@kvack.org
> Signed-off-by: Richard Cochran <rcochran@linutronix.de>

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

Thanks

> ---
>  mm/memcontrol.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index d06cae2..993a261 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -1916,9 +1916,6 @@ static int memcg_cpu_hotplug_callback(struct notifier_block *nb,
>  	int cpu = (unsigned long)hcpu;
>  	struct memcg_stock_pcp *stock;
>  
> -	if (action == CPU_ONLINE)
> -		return NOTIFY_OK;
> -
>  	if (action != CPU_DEAD && action != CPU_DEAD_FROZEN)
>  		return NOTIFY_OK;
>  
> -- 
> 2.1.4

-- 
Michal Hocko
SUSE Labs

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web