lkml.org 
[lkml]   [2015]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable
On Wed, Jun 24, 2015 at 11:43:33AM +0200, 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.

Any code using this had better be open source, if not I really don't
care anyway.

That really ought to be:

WARN_ON(--cpu_hotplug_disabled < 0);

You do not make underflows go away.


\
 
 \ /
  Last update: 2015-06-24 12:41    [W:0.045 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site