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


Groups > linux.kernel > #1667641 > unrolled thread

Re: [PATCH 3/8] genirq/affinity: factor out a irq_affinity_set helper

Started byThomas Gleixner <tglx@linutronix.de>
First post2017-06-16 13:10 +0200
Last post2017-06-16 14:10 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 3/8] genirq/affinity: factor out a irq_affinity_set  helper Thomas Gleixner <tglx@linutronix.de> - 2017-06-16 13:10 +0200
    Re: [PATCH 3/8] genirq/affinity: factor out a irq_affinity_set  helper Thomas Gleixner <tglx@linutronix.de> - 2017-06-16 14:10 +0200

#1667641 — Re: [PATCH 3/8] genirq/affinity: factor out a irq_affinity_set helper

FromThomas Gleixner <tglx@linutronix.de>
Date2017-06-16 13:10 +0200
SubjectRe: [PATCH 3/8] genirq/affinity: factor out a irq_affinity_set helper
Message-ID<tSXix-7EM-1@gated-at.bofh.it>
On Sat, 3 Jun 2017, Christoph Hellwig wrote:
> +bool irq_affinity_set(int irq, struct irq_desc *desc, const cpumask_t *mask)
> +{
> +	struct irq_data *data = irq_desc_get_irq_data(desc);
> +	struct irq_chip *chip = irq_data_get_irq_chip(data);
> +	bool ret = false;
> +
> +	if (!irq_can_move_pcntxt(data) && chip->irq_mask)
> +		chip->irq_mask(data);
> +
> +	if (chip->irq_set_affinity) {
> +		if (chip->irq_set_affinity(data, mask, true) == -ENOSPC)
> +			pr_crit("IRQ %d set affinity failed because there are no available vectors.  The device assigned to this IRQ is unstable.\n", irq);
> +		ret = true;
> +	}
> +
> +	/*
> +	 * We unmask if the irq was not marked masked by the core code.
> +	 * That respects the lazy irq disable behaviour.
> +	 */
> +	if (!irq_can_move_pcntxt(data) &&
> +	    !irqd_irq_masked(data) && chip->irq_unmask)
> +		chip->irq_unmask(data);

There is another issue with this. Nothing updates the affinity mask in
irq_desc, when we just invoke the chip callback. Let me have a look.

Thanks,

	tglx

[toc] | [next] | [standalone]


#1667691

FromThomas Gleixner <tglx@linutronix.de>
Date2017-06-16 14:10 +0200
Message-ID<tSYeC-8fF-31@gated-at.bofh.it>
In reply to#1667641
On Fri, 16 Jun 2017, Thomas Gleixner wrote:
> On Sat, 3 Jun 2017, Christoph Hellwig wrote:
> > +bool irq_affinity_set(int irq, struct irq_desc *desc, const cpumask_t *mask)
> > +{
> > +	struct irq_data *data = irq_desc_get_irq_data(desc);
> > +	struct irq_chip *chip = irq_data_get_irq_chip(data);
> > +	bool ret = false;
> > +
> > +	if (!irq_can_move_pcntxt(data) && chip->irq_mask)
> > +		chip->irq_mask(data);
> > +
> > +	if (chip->irq_set_affinity) {
> > +		if (chip->irq_set_affinity(data, mask, true) == -ENOSPC)
> > +			pr_crit("IRQ %d set affinity failed because there are no available vectors.  The device assigned to this IRQ is unstable.\n", irq);
> > +		ret = true;
> > +	}
> > +
> > +	/*
> > +	 * We unmask if the irq was not marked masked by the core code.
> > +	 * That respects the lazy irq disable behaviour.
> > +	 */
> > +	if (!irq_can_move_pcntxt(data) &&
> > +	    !irqd_irq_masked(data) && chip->irq_unmask)
> > +		chip->irq_unmask(data);
> 
> There is another issue with this. Nothing updates the affinity mask in
> irq_desc, when we just invoke the chip callback. Let me have a look.

Indeed. So that magic you do in the next patches (the hotplug callbacks)
only work proper for affinity masks with a single cpu set.

The problem is that we don't have a distinction between the 'possible'
(e.g. set by /proc/irq/affinity) and the effective affinity mask.

Needs more thought.

Thanks,

	tglx

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web