Re: [PATCH] lscpu: fix incorrect number of sockets during hotplug

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

 



 HI,

 sorry for delay with review.

On Fri, Oct 18, 2024 at 04:13:35PM GMT, Anjali K wrote:
>  /* add @set to the @ary, unnecessary set is deallocated. */
> -static int add_cpuset_to_array(cpu_set_t **ary, size_t *items, cpu_set_t *set, size_t setsize)
> +static int add_cpuset_to_array(cpu_set_t **ary, size_t *items, cpu_set_t *set, size_t setsize, int maxcpus)
>  {
> +	cpu_set_t *common_cpus_set;
>  	size_t i;
>  
>  	if (!ary)
>  		return -EINVAL;
>  
> +	common_cpus_set = CPU_ALLOC(maxcpus);
> +	if (!common_cpus_set)
> +		return -EINVAL;

Would be better to allocate this only once in cputype_read_topology()
and reuse it for all the arrays and CPUs? 

The rest looks good. Thanks!

 Karel



-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com





[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux