2005-11-09 11:07:42

by Kirill Korotaev

[permalink] [raw]
Subject: [PATCH] stop_machine() vs. synchronous IPI send deadlock

--- ./kernel/stop_machine.c.stpmach 2005-11-01 12:06:03.000000000 +0300
+++ ./kernel/stop_machine.c 2005-11-09 13:58:03.000000000 +0300
@@ -114,13 +114,12 @@ static int stop_machine(void)
return ret;
}

- /* Don't schedule us away at this point, please. */
- local_irq_disable();
-
/* Now they are all started, make them hold the CPUs, ready. */
+ preempt_disable();
stopmachine_set_state(STOPMACHINE_PREPARE);

/* Make them disable irqs. */
+ local_irq_disable();
stopmachine_set_state(STOPMACHINE_DISABLE_IRQ);

return 0;


Attachments:
diff-stopmachine (542.00 B)

2005-11-09 17:32:55

by Kirill Korotaev

[permalink] [raw]
Subject: Re: [PATCH] stop_machine() vs. synchronous IPI send deadlock

--- ./kernel/stop_machine.c.stpmach 2005-11-01 12:06:03.000000000 +0300
+++ ./kernel/stop_machine.c 2005-11-09 20:38:23.000000000 +0300
@@ -114,13 +114,12 @@ static int stop_machine(void)
return ret;
}

- /* Don't schedule us away at this point, please. */
- local_irq_disable();
-
/* Now they are all started, make them hold the CPUs, ready. */
+ preempt_disable();
stopmachine_set_state(STOPMACHINE_PREPARE);

/* Make them disable irqs. */
+ local_irq_disable();
stopmachine_set_state(STOPMACHINE_DISABLE_IRQ);

return 0;
@@ -130,6 +129,7 @@ static void restart_machine(void)
{
stopmachine_set_state(STOPMACHINE_EXIT);
local_irq_enable();
+ preempt_enable_no_resched();
}

struct stop_machine_data


Attachments:
diff-ms-stopmachine-ipi-deadlock-2 (726.00 B)