Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753427AbcCUIR0 (ORCPT ); Mon, 21 Mar 2016 04:17:26 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34998 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753015AbcCUIRU (ORCPT ); Mon, 21 Mar 2016 04:17:20 -0400 Date: Mon, 21 Mar 2016 09:17:17 +0100 From: Michal Hocko To: Richard Cochran Cc: linux-kernel@vger.kernel.org, rt@linutronix.de, Johannes Weiner , Vladimir Davydov , cgroups@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 1/5] mm: memcontrol: Remove redundant hot plug notifier test. Message-ID: <20160321081717.GA21248@dhcp22.suse.cz> References: <1458336371-17748-1-git-send-email-rcochran@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1458336371-17748-1-git-send-email-rcochran@linutronix.de> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1268 Lines: 45 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 > Cc: Michal Hocko > Cc: Vladimir Davydov > Cc: cgroups@vger.kernel.org > Cc: linux-mm@kvack.org > Signed-off-by: Richard Cochran Acked-by: Michal Hocko 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