]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
smp: Fix offline cpu check in flush_smp_call_function_queue()
authorNadav Amit <namit@vmware.com>
Sat, 19 Mar 2022 07:20:15 +0000 (00:20 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 10:01:03 +0000 (12:01 +0200)
commit0ab1d1bba3377c7c0e7b7c05af630153179abd81
tree7c28be09b924e9aaad281ba1ee45a8fd55eb4994
parentef1ffa192e0d487a1d7dfcbd04f67f4a44b46950
smp: Fix offline cpu check in flush_smp_call_function_queue()

BugLink: https://bugs.launchpad.net/bugs/1969857
commit 9e949a3886356fe9112c6f6f34a6e23d1d35407f upstream.

The check in flush_smp_call_function_queue() for callbacks that are sent
to offline CPUs currently checks whether the queue is empty.

However, flush_smp_call_function_queue() has just deleted all the
callbacks from the queue and moved all the entries into a local list.
This checks would only be positive if some callbacks were added in the
short time after llist_del_all() was called. This does not seem to be
the intention of this check.

Change the check to look at the local list to which the entries were
moved instead of the queue from which all the callbacks were just
removed.

Fixes: 8d056c48e4862 ("CPU hotplug, smp: flush any pending IPI callbacks before CPU offline")
Signed-off-by: Nadav Amit <namit@vmware.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20220319072015.1495036-1-namit@vmware.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
kernel/smp.c