Re: [PATCH 02/13] genirq/affinity: Provide smarter irq spreading infrastructure

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

 



On Wed, Sep 14, 2016 at 04:18:48PM +0200, Christoph Hellwig wrote:
> +/**
> + * irq_calc_affinity_vectors - Calculate to optimal number of vectors for a given affinity mask
> + * @affinity:		The affinity mask to spread. If NULL cpu_online_mask
> + *			is used
> + * @maxvec:		The maximum number of vectors available
> + */
> +int irq_calc_affinity_vectors(const struct cpumask *affinity, int maxvec)
> +{
> +	int cpus, ret;
> +
> +	/* Stabilize the cpumasks */
> +	get_online_cpus();
> +	/* If the supplied affinity mask is NULL, use cpu online mask */
> +	if (!affinity)
> +		affinity = cpu_online_mask;
> +
> +	cpus = cpumask_weight(affinity);

Should not we consider the result of AND of affinity and cpu_online_mask?

> +	ret = (cpus < maxvec) ? cpus : maxvec;
> +
> +	put_online_cpus();
> +	return ret;
> +}
> +
>  static int get_first_sibling(unsigned int cpu)
>  {
>  	unsigned int ret;
> -- 
> 2.1.4
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux