Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1488079

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

From Alexander Gordeev <agordeev@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 02/13] genirq/affinity: Provide smarter irq spreading infrastructure
Date 2016-09-21 14:30 +0200
Message-ID <sjOP0-vu-19@gated-at.bofh.it> (permalink)
References <shjcB-1Ui-7@gated-at.bofh.it> <shjmh-1XX-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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
> 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

blk-mq: allow passing in an external queue mapping V3 Christoph Hellwig <hch@lst.de> - 2016-09-14 16:20 +0200
  [PATCH 06/13] blk-mq: don't redistribute hardware queues on a CPU hotplug event Christoph Hellwig <hch@lst.de> - 2016-09-14 16:20 +0200
  [PATCH 08/13] blk-mq: remove ->map_queue Christoph Hellwig <hch@lst.de> - 2016-09-14 16:20 +0200
  [PATCH 10/13] blk-mq: provide a default queue mapping for PCI device Christoph Hellwig <hch@lst.de> - 2016-09-14 16:20 +0200
    Re: [PATCH 10/13] blk-mq: provide a default queue mapping for PCI  device Alexander Gordeev <agordeev@redhat.com> - 2016-09-19 09:30 +0200
      Re: [PATCH 10/13] blk-mq: provide a default queue mapping for PCI         device Christoph Hellwig <hch@lst.de> - 2016-09-19 15:50 +0200
  [PATCH 09/13] blk-mq: allow the driver to pass in a queue mapping Christoph Hellwig <hch@lst.de> - 2016-09-14 16:30 +0200
  [PATCH 02/13] genirq/affinity: Provide smarter irq spreading infrastructure Christoph Hellwig <hch@lst.de> - 2016-09-14 16:30 +0200
    [tip:irq/core] genirq/affinity: Provide smarter irq spreading  infrastructure tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-09-15 21:10 +0200
    Re: [PATCH 02/13] genirq/affinity: Provide smarter irq spreading  infrastructure Alexander Gordeev <agordeev@redhat.com> - 2016-09-21 14:30 +0200
      Re: [PATCH 02/13] genirq/affinity: Provide smarter irq spreading  infrastructure Thomas Gleixner <tglx@linutronix.de> - 2016-09-22 23:20 +0200
  [PATCH 07/13] blk-mq: only allocate a single mq_map per tag_set Christoph Hellwig <hch@lst.de> - 2016-09-14 16:30 +0200
  [PATCH 13/13] blk-mq: get rid of the cpumask in struct blk_mq_tags Christoph Hellwig <hch@lst.de> - 2016-09-14 16:30 +0200
    Re: [PATCH 13/13] blk-mq: get rid of the cpumask in struct  blk_mq_tags Christoph Hellwig <hch@infradead.org> - 2016-09-15 16:50 +0200
  [PATCH 11/13] nvme: switch to use pci_alloc_irq_vectors Christoph Hellwig <hch@lst.de> - 2016-09-14 16:30 +0200
  [PATCH 04/13] genirq/affinity: Remove old irq spread infrastructure Christoph Hellwig <hch@lst.de> - 2016-09-14 16:30 +0200
    [tip:irq/core] genirq/affinity: Remove old irq spread  infrastructure tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-09-15 21:10 +0200
  [PATCH 05/13] pci/msi: Retrieve affinity for a vector Christoph Hellwig <hch@lst.de> - 2016-09-14 16:30 +0200
    [tip:irq/core] pci/msi: Retrieve affinity for a vector tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-09-15 21:10 +0200
  Re: blk-mq: allow passing in an external queue mapping V3 Christoph Hellwig <hch@lst.de> - 2016-09-15 16:40 +0200
    Re: blk-mq: allow passing in an external queue mapping V3 Christoph Hellwig <hch@lst.de> - 2016-09-15 16:50 +0200
  Re: blk-mq: allow passing in an external queue mapping V3 Keith Busch <keith.busch@intel.com> - 2016-09-15 16:40 +0200

csiph-web