x86/apic/vector: Handle vector release on CPU unplug correctly
authorThomas Gleixner <tglx@linutronix.de>
Thu, 22 Feb 2018 11:08:06 +0000 (12:08 +0100)
committerIngo Molnar <mingo@kernel.org>
Fri, 23 Feb 2018 07:02:00 +0000 (08:02 +0100)
commite84cf6aa501c58bf4bf451f1e425192ec090aed2
treeebec102e04acad9e894548422959b8be3300e69c
parent651ca2c00405a2ae3870cc0b4f15a182eb6fbe26
x86/apic/vector: Handle vector release on CPU unplug correctly

When a irq vector is replaced, then the previous vector is normally
released when the first interrupt happens on the new vector. If the target
CPU of the previous vector is already offline when the new vector is
installed, then the previous vector is silently discarded, which leads to
accounting issues causing suspend failures and other problems.

Adjust the logic so that the previous vector is freed in the underlying
matrix allocator to ensure that the accounting stays correct.

Fixes: 69cde0004a4b ("x86/vector: Use matrix allocator for vector assignment")
Reported-by: Yuriy Vostrikov <delamonpansie@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Yuriy Vostrikov <delamonpansie@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20180222112316.930791749@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/apic/vector.c