summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorNadav Amit <namit@vmware.com>2022-03-19 00:20:15 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-20 09:08:33 +0200
commit0f088623b6db0d533fe7fa787d0283b58a275b18 (patch)
tree4919194c34626983b1788b3ab1275b3628bc1dbb /kernel
parenta12b356d45cbb6e8a1b718d1436b3d6239a862f3 (diff)
smp: Fix offline cpu check in flush_smp_call_function_queue()
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>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/smp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/smp.c b/kernel/smp.c
index f9d95d59b7ed..d519c792c9d5 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -221,7 +221,7 @@ static void flush_smp_call_function_queue(bool warn_cpu_offline)
/* There shouldn't be any pending callbacks on an offline CPU. */
if (unlikely(warn_cpu_offline && !cpu_online(smp_processor_id()) &&
- !warned && !llist_empty(head))) {
+ !warned && entry != NULL)) {
warned = true;
WARN(1, "IPI on offline CPU %d\n", smp_processor_id());