<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/kernel/irq/cpuhotplug.c, branch linux-4.13.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.13.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.13.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2017-10-18T07:38:31Z</updated>
<entry>
<title>genirq/cpuhotplug: Add sanity check for effective affinity mask</title>
<updated>2017-10-18T07:38:31Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2017-10-09T10:47:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=709d1ac12dc68dbd48a49a809409e64b1c2f0a9e'/>
<id>urn:sha1:709d1ac12dc68dbd48a49a809409e64b1c2f0a9e</id>
<content type='text'>
commit 60b09c51bb4fb46e2331fdbb39f91520f31d35f7 upstream.

The effective affinity mask handling has no safety net when the mask is not
updated by the interrupt chip or the mask contains offline CPUs.

If that happens the CPU unplug code fails to migrate interrupts.

Add sanity checks and emit a warning when the mask contains only offline
CPUs.

Fixes: 415fcf1a2293 ("genirq/cpuhotplug: Use effective affinity mask")
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Link: http://lkml.kernel.org/r/alpine.DEB.2.20.1710042208400.2406@nanos
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>genirq/cpuhotplug: Revert "Set force affinity flag on hotplug migration"</title>
<updated>2017-07-27T13:40:02Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2017-07-27T10:21:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8397913303abc9333f376a518a8368fa22ca5e6e'/>
<id>urn:sha1:8397913303abc9333f376a518a8368fa22ca5e6e</id>
<content type='text'>
That commit was part of the changes moving x86 to the generic CPU hotplug
interrupt migration code. The force flag was required on x86 before the
hierarchical irqdomain rework, but invoking set_affinity() with force=true
stayed and had no side effects.

At some point in the past, the force flag got repurposed to support the
exynos timer interrupt affinity setting to a not yet online CPU, so the
interrupt controller callback does not verify the supplied affinity mask
against cpu_online_mask.

Setting the flag in the CPU hotplug code causes the cpu online masking to
be blocked on these irq controllers and results in potentially affining an
interrupt to the CPU which is unplugged, i.e. instead of moving it away,
it's just reassigned to it.

As the force flags is not longer needed on x86, it's safe to revert that
patch so the ARM irqchips which use the force flag work again.

Add comments to that effect, so this won't happen again.

Note: The online mask handling should be done in the generic code and the
force flag and the masking in the irq chips removed all together, but
that's not a change possible for 4.13. 

Fixes: 77f85e66aa8b ("genirq/cpuhotplug: Set force affinity flag on hotplug migration")
Reported-by: Will Deacon &lt;will.deacon@arm.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Will Deacon &lt;will.deacon@arm.com&gt;
Cc: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Cc: Russell King &lt;linux@arm.linux.org.uk&gt;
Cc: LAK &lt;linux-arm-kernel@lists.infradead.org&gt;
Link: http://lkml.kernel.org/r/alpine.DEB.2.20.1707271217590.3109@nanos
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;

</content>
</entry>
<entry>
<title>genirq/cpuhotplug: Avoid irq affinity setting for single targets</title>
<updated>2017-06-22T16:21:25Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2017-06-19T23:37:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8f31a9845db348f5781df47ce04c79e4cfe90016'/>
<id>urn:sha1:8f31a9845db348f5781df47ce04c79e4cfe90016</id>
<content type='text'>
Avoid trying to add a newly online CPU to the effective affinity mask of an
started up interrupt. That interrupt will either stay on the already online
CPU or move around for no value.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Cc: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: Keith Busch &lt;keith.busch@intel.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Link: http://lkml.kernel.org/r/20170619235447.431321047@linutronix.de

</content>
</entry>
<entry>
<title>genirq/cpuhotplug: Handle managed IRQs on CPU hotplug</title>
<updated>2017-06-22T16:21:25Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2017-06-19T23:37:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c5cb83bb337c25caae995d992d1cdf9b317f83de'/>
<id>urn:sha1:c5cb83bb337c25caae995d992d1cdf9b317f83de</id>
<content type='text'>
If a CPU goes offline, interrupts affine to the CPU are moved away. If the
outgoing CPU is the last CPU in the affinity mask the migration code breaks
the affinity and sets it it all online cpus.

This is a problem for affinity managed interrupts as CPU hotplug is often
used for power management purposes. If the affinity is broken, the
interrupt is not longer affine to the CPUs to which it was allocated.

The affinity spreading allows to lay out multi queue devices in a way that
they are assigned to a single CPU or a group of CPUs. If the last CPU goes
offline, then the queue is not longer used, so the interrupt can be
shutdown gracefully and parked until one of the assigned CPUs comes online
again.

Add a graceful shutdown mechanism into the irq affinity breaking code path,
mark the irq as MANAGED_SHUTDOWN and leave the affinity mask unmodified.

In the online path, scan the active interrupts for managed interrupts and
if the interrupt is functional and the newly online CPU is part of the
affinity mask, restart the interrupt if it is marked MANAGED_SHUTDOWN or if
the interrupts is started up, try to add the CPU back to the effective
affinity mask.

Originally-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Cc: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: Keith Busch &lt;keith.busch@intel.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/r/20170619235447.273417334@linutronix.de

</content>
</entry>
<entry>
<title>genirq/cpuhotplug: Use effective affinity mask</title>
<updated>2017-06-22T16:21:21Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2017-06-19T23:37:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=415fcf1a2293046e0c1f4ab8558a87bad66652b1'/>
<id>urn:sha1:415fcf1a2293046e0c1f4ab8558a87bad66652b1</id>
<content type='text'>
If the architecture supports the effective affinity mask, migrating
interrupts away which are not targeted by the effective mask is
pointless.

They can stay in the user or system supplied affinity mask, but won't be
targetted at any given point as the affinity setter functions need to
validate against the online cpu mask anyway.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Cc: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: Keith Busch &lt;keith.busch@intel.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Link: http://lkml.kernel.org/r/20170619235446.328488490@linutronix.de

</content>
</entry>
<entry>
<title>genirq/cpuhotplug: Set force affinity flag on hotplug migration</title>
<updated>2017-06-22T16:21:18Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2017-06-19T23:37:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=77f85e66aa8be563ae5804eebf74a78ec6ef5555'/>
<id>urn:sha1:77f85e66aa8be563ae5804eebf74a78ec6ef5555</id>
<content type='text'>
Set the force migration flag when migrating interrupts away from an
outgoing CPU.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Cc: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: Keith Busch &lt;keith.busch@intel.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Link: http://lkml.kernel.org/r/20170619235445.681874648@linutronix.de

</content>
</entry>
<entry>
<title>genirq/cpuhotplug: Add support for conditional masking</title>
<updated>2017-06-22T16:21:17Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2017-06-19T23:37:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=47a06d3a783217acae02976f15ca07ddc1ac024f'/>
<id>urn:sha1:47a06d3a783217acae02976f15ca07ddc1ac024f</id>
<content type='text'>
Interrupts which cannot be migrated in process context, need to be masked
before the affinity is changed forcefully.

Add support for that. Will be compiled out for architectures which do not
have this x86 specific issue.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Cc: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: Keith Busch &lt;keith.busch@intel.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Link: http://lkml.kernel.org/r/20170619235445.604565591@linutronix.de

</content>
</entry>
<entry>
<title>genirq/cpuhotplug: Add support for cleaning up move in progress</title>
<updated>2017-06-22T16:21:17Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2017-06-19T23:37:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f0383c24b4855f6a4b5a358c7b2d2c16e0437e9b'/>
<id>urn:sha1:f0383c24b4855f6a4b5a358c7b2d2c16e0437e9b</id>
<content type='text'>
In order to move x86 to the generic hotplug migration code, add support for
cleaning up move in progress bits.

On architectures which have this x86 specific (mis)feature not enabled,
this is optimized out by the compiler.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Cc: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: Keith Busch &lt;keith.busch@intel.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Link: http://lkml.kernel.org/r/20170619235445.525817311@linutronix.de

</content>
</entry>
<entry>
<title>genirq/cpuhotplug: Do not migrated shutdown irqs</title>
<updated>2017-06-22T16:21:17Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2017-06-19T23:37:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=91f26cb4cd3c22bd656ab46c49329aacaaab5504'/>
<id>urn:sha1:91f26cb4cd3c22bd656ab46c49329aacaaab5504</id>
<content type='text'>
Interrupts, which are shut down are tried to be migrated as well. That's
pointless because the interrupt cannot fire and the next startup will move
it to the proper place anyway.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Cc: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: Keith Busch &lt;keith.busch@intel.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Link: http://lkml.kernel.org/r/20170619235445.447550992@linutronix.de

</content>
</entry>
<entry>
<title>genirq/cpuhotplug: Reorder check logic</title>
<updated>2017-06-22T16:21:16Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2017-06-19T23:37:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e8a7035039306c90bcc99129ffc18e0be052bbb9'/>
<id>urn:sha1:e8a7035039306c90bcc99129ffc18e0be052bbb9</id>
<content type='text'>
Move the checks for a valid irq chip and the irq_set_affinity() callback
right in front of the whole migration logic. No point in doing a gazillion
of other things when the interrupt cannot be migrated at all.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Cc: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: Keith Busch &lt;keith.busch@intel.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Link: http://lkml.kernel.org/r/20170619235445.354181630@linutronix.de

</content>
</entry>
</feed>
