Skip to content

Commit 883f1ec

Browse files
committed
smp: Fix offline cpu check in flush_smp_call_function_queue()
JIRA: https://issues.redhat.com/browse/RHEL-16867 commit 9e949a3 Author: Nadav Amit <nadav.amit@gmail.com> Date: Sat, 19 Mar 2022 00:20:15 -0700 smp: Fix offline cpu check in flush_smp_call_function_queue() 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: 8d056c4 ("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: Waiman Long <longman@redhat.com>
1 parent c1fb3da commit 883f1ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/smp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ static void __flush_smp_call_function_queue(bool warn_cpu_offline)
441441

442442
/* There shouldn't be any pending callbacks on an offline CPU. */
443443
if (unlikely(warn_cpu_offline && !cpu_online(smp_processor_id()) &&
444-
!warned && !llist_empty(head))) {
444+
!warned && entry != NULL)) {
445445
warned = true;
446446
WARN(1, "IPI on offline CPU %d\n", smp_processor_id());
447447

0 commit comments

Comments
 (0)