From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753306AbcFGGgR (ORCPT ); Tue, 7 Jun 2016 02:36:17 -0400 Received: from www.linutronix.de ([62.245.132.108]:36946 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751031AbcFGGgQ (ORCPT ); Tue, 7 Jun 2016 02:36:16 -0400 Date: Tue, 7 Jun 2016 08:34:12 +0200 (CEST) From: Thomas Gleixner To: Lianwei Wang cc: peterz@infradead.org, oleg@redhat.com, mingo@kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH v2] cpu/hotplug: handle unbalanced hotplug enable/disable In-Reply-To: <1465279021-3299-1-git-send-email-lianwei.wang@gmail.com> Message-ID: References: <1465279021-3299-1-git-send-email-lianwei.wang@gmail.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 6 Jun 2016, Lianwei Wang wrote: > Currently it just print a warning message but did not > reset cpu_hotplug_disabled when the enable/disable is > unbalanced. The unbalanced enable/disable will lead > the cpu hotplug work abnormally. > > Do nothing if an unablanced hotplug enable detected. > > Signed-off-by: Lianwei Wang > --- > kernel/cpu.c | 21 +++++++++++++++++---- > 1 file changed, 17 insertions(+), 4 deletions(-) > > diff --git a/kernel/cpu.c b/kernel/cpu.c > index 3e3f6e49eabb..8011b1e40523 100644 > --- a/kernel/cpu.c > +++ b/kernel/cpu.c > @@ -245,6 +245,19 @@ void cpu_hotplug_done(void) > cpuhp_lock_release(); > } > > +static void _cpu_hotplug_disable(void) What's the purpose of this function? > +{ > + cpu_hotplug_disabled++; > +} > + > +static void _cpu_hotplug_enable(void) Double underscores please > +{ > + if (WARN(!cpu_hotplug_disabled, "Unbalanced cpu hotplug enable\n")) > + return; And this want's to be a WARN_ONCE() Thanks, tglx