public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>,
	KY Srinivasan <kys@microsoft.com>,
	"gregkh\@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devel\@linuxdriverproject.org" <devel@linuxdriverproject.org>,
	"mingo\@kernel.org" <mingo@kernel.org>,
	"rafael.j.wysocki\@intel.com" <rafael.j.wysocki@intel.com>
Subject: Re: [PATCH 1/1] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable
Date: Wed, 24 Jun 2015 13:11:53 +0200	[thread overview]
Message-ID: <87pp4l743q.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1506241152410.4037@nanos> (Thomas Gleixner's message of "Wed, 24 Jun 2015 11:54:05 +0200 (CEST)")

Thomas Gleixner <tglx@linutronix.de> writes:

> On Wed, 24 Jun 2015, Vitaly Kuznetsov wrote:
>
>> Peter Zijlstra <peterz@infradead.org> 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

  reply	other threads:[~2015-06-24 11:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-22  2:56 [PATCH 1/1] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable K. Y. Srinivasan
2015-06-23 16:57 ` KY Srinivasan
2015-06-23 18:13   ` Peter Zijlstra
2015-06-24  9:43     ` Vitaly Kuznetsov
2015-06-24  9:54       ` Thomas Gleixner
2015-06-24 11:11         ` Vitaly Kuznetsov [this message]
2015-06-24 10:27       ` Peter Zijlstra
2015-06-24 11:14         ` Vitaly Kuznetsov

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=87pp4l743q.fsf@vitty.brq.redhat.com \
    --to=vkuznets@redhat.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=tglx@linutronix.de \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox