[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CA+hQ2+hMjpifq4ef1u4pfvXvgjCp4G7qMSE=GciHarVGrXC3pg@mail.gmail.com>
Date: Sat, 22 Jun 2019 10:54:36 -0700
From: Luigi Rizzo <rizzo@....unipi.it>
To: linux-kernel@...r.kernel.org
Subject: Q: incorrect llist_empty() call in flush_smp_call_function_queue ?
flush_smp_call_function_queue() starts with the code below.
My impression is that the !llist_empty(head) term below is wrong
and should be replaced by !entry
llist_del_all(head) is xchg(&head->first, NULL) so it leaves the list empty,
the only chance that !llist_empty(head) is true is when a new element is
added between llist_del_add and the test of the condition, whereas judging
from the comment the intent seems to be that the warning should be printed
also when there are previous elements.
static void flush_smp_call_function_queue(bool warn_cpu_offline)
{
...
head = this_cpu_ptr(&call_single_queue);
entry = llist_del_all(head);
entry = llist_reverse_order(entry);
/* 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 = true;
WARN(1, "IPI on offline CPU %d\n", smp_processor_id());
--
cheers
luigi
Powered by blists - more mailing lists