Re: [PATCH 3/8] Use process freezer for cpu-hotplug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ingo Molnar wrote:
> 
> * Nathan Lynch <[email protected]> wrote:
> 
> > > -	raw_notifier_call_chain(&cpu_chain, CPU_LOCK_ACQUIRE, hcpu);
> > > +	if (freeze_processes(FE_HOTPLUG_CPU)) {
> > > +		thaw_processes(FE_HOTPLUG_CPU);
> > > +		return -EBUSY;
> > > +	}
> > > +
> > 
> > If I'm understanding correctly, this will cause
> > 
> > # echo 0 > /sys/devices/system/cpu/cpuX/online
> > 
> > to sometimes fail, and userspace is expected to try again?  This will 
> > break existing applications.
> > 
> > Perhaps drivers/base/cpu.c:store_online should retry as long as 
> > cpu_up/down return -EBUSY.  That would avoid a userspace-visible 
> > interface change.
> 
> yeah. I'd even suggest a freeze_processes_nofail() API instead, that 
> does this internally, without burdening the callsites. (and once the 
> freezer becomes complete then freeze_processes_nofail() == 
> freeze_processes())

Yeah, I just realized that an implementation of my proposal would busy
loop in the kernel forever if a silly admin tried to offline the last
cpu (we're already using -EBUSY for that case), so
freeze_processes_nofail is a better idea :-)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux