Skip to content

Instantly share code, notes, and snippets.

@marmarek
Created October 31, 2020 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marmarek/810ae5c079d218928535514b08a07716 to your computer and use it in GitHub Desktop.
Save marmarek/810ae5c079d218928535514b08a07716 to your computer and use it in GitHub Desktop.
diff --git a/xen/common/smp.c b/xen/common/smp.c
index 79f4ebd14502..155d6d52f655 100644
--- a/xen/common/smp.c
+++ b/xen/common/smp.c
@@ -51,6 +51,7 @@ void on_selected_cpus(
int wait)
{
unsigned int nr_cpus;
+ unsigned long counter = 0;
ASSERT(local_irq_is_enabled());
ASSERT(cpumask_subset(selected, &cpu_online_map));
@@ -69,8 +70,15 @@ void on_selected_cpus(
smp_send_call_function_mask(&call_data.selected);
- while ( !cpumask_empty(&call_data.selected) )
+ while ( !cpumask_empty(&call_data.selected) ) {
+ if (counter > 100000) {
+ printk(XENLOG_WARNING "still waiting for %*pbl\n", CPUMASK_PR(&call_data.selected));
+ WARN();
+ counter = 0;
+ }
+ counter++;
cpu_relax();
+ }
out:
spin_unlock(&call_lock);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment