Re: [PATCH] lpfc: fixup out-of-bounds access during CPU hotplug

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

 



On Tue, 2019-11-19 at 09:17 -0800, James Smart wrote:
> 
> > Actually, the behaviour of num_possible_cpus() under cpu hotplug seems 
> > to be implementation-specific.
> > One might want to set it to the max value at all times, which has the 
> > drawback that you'd need to scale per-cpu values with that number, 
> > leading to a massive memory overhead as only very few installation 
> > will ever reach that number.
> > Others might want to set to the max value at the current 
> > configuration, implying that it might change under CPU hotplug.
> > Which seems to be the case for PowerPC, which was the case which 
> > triggered the issue at hand.
> > But maybe it was a plain bug in the CPU hotplug implementation; one 
> > should be asking BenH for details here.
> > 
> > Cheers,
> > 
> > Hannes
> 
> That sure seems to be at odds with this comment from 
> include/linux/cpumask.h:
> 
>   *  The cpu_possible_mask is fixed at boot time, as the set of CPU id's
>   *  that it is possible might ever be plugged in at anytime during the
>   *  life of that system boot.  The cpu_present_mask is dynamic(*),
>   *  representing which CPUs are currently plugged in.  And
>   *  cpu_online_mask is the dynamic subset of cpu_present_mask,
>   *  indicating those CPUs available for scheduling.
> 
> and
> #define num_possible_cpus()     cpumask_weight(cpu_possible_mask)

Right, it should be fixed at boot. Where do you see powerpc change it ?

Cheers,
Ben.




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux