From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752381AbbFXLMF (ORCPT ); Wed, 24 Jun 2015 07:12:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40426 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751024AbbFXLL5 (ORCPT ); Wed, 24 Jun 2015 07:11:57 -0400 From: Vitaly Kuznetsov To: Thomas Gleixner Cc: Peter Zijlstra , KY Srinivasan , "gregkh\@linuxfoundation.org" , "linux-kernel\@vger.kernel.org" , "devel\@linuxdriverproject.org" , "mingo\@kernel.org" , "rafael.j.wysocki\@intel.com" Subject: Re: [PATCH 1/1] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable References: <1434941760-16858-1-git-send-email-kys@microsoft.com> <20150623181310.GG3644@twins.programming.kicks-ass.net> <87twtx786y.fsf@vitty.brq.redhat.com> Date: Wed, 24 Jun 2015 13:11:53 +0200 In-Reply-To: (Thomas Gleixner's message of "Wed, 24 Jun 2015 11:54:05 +0200 (CEST)") Message-ID: <87pp4l743q.fsf@vitty.brq.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thomas Gleixner writes: > On Wed, 24 Jun 2015, Vitaly Kuznetsov wrote: > >> Peter Zijlstra writes: >> >> > On Tue, Jun 23, 2015 at 04:57:05PM +0000, KY Srinivasan wrote: >> > >> >> > diff --git a/kernel/cpu.c b/kernel/cpu.c >> >> > index 94bbe46..8f35ee6 100644 >> >> > --- a/kernel/cpu.c >> >> > +++ b/kernel/cpu.c >> >> > @@ -190,17 +190,19 @@ void cpu_hotplug_done(void) >> >> > void cpu_hotplug_disable(void) >> >> > { >> >> > cpu_maps_update_begin(); >> >> > - cpu_hotplug_disabled = 1; >> >> > + cpu_hotplug_disabled++; >> >> > cpu_maps_update_done(); >> >> > } >> >> > +EXPORT_SYMBOL_GPL(cpu_hotplug_disable); >> >> > >> >> > void cpu_hotplug_enable(void) >> >> > { >> >> > cpu_maps_update_begin(); >> >> > - cpu_hotplug_disabled = 0; >> >> > + if (cpu_hotplug_disabled) >> >> > + cpu_hotplug_disabled--; >> > >> > No that just papers over bugs. >> > >> >> Yes, but these bugs are not in Linux. I don't see any other way for a >> platform to enable/disable cpu hotplug in runtime. > > What? cpu_hotplug_disable()/enable() do that today. They just do not > support recursion and we have not yet seen any argument WHY that's > required at all. They do, my patch just exports them. Despite the fact that I have no specific usecase in my mind at this time I still see a theoretical possibility of this being useful - when two pieces of code are trying to enable/disable cpu hotplug simultaneously. Without making cpu_hotplug_disabled a counter disable->disable->enable sequence will lead to cpu hotplug being enabled. -- Vitaly