Re: 2.6.13-rc6-rt6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2005-08-17 at 13:32 -0400, Steven Rostedt wrote:
> On Wed, 2005-08-17 at 08:47 +0200, Ingo Molnar wrote:
> 
> > but stop_machine() looks quite preempt-unsafe to begin with. The 
> > local_irq_disable() would not be needed at all if prior the 
> > for_each_online_cpu() loop we'd use set_cpus_allowed. The current method 
> > of achieving 'no preemption' is simply racy even during normal 
> > CONFIG_PREEMPT.
> 
> The code does look flakey, but I think it still works, and it may need
> to have a raw_local_irq_disable.

I added this patch to my AMD box is it runs fine.  So I'm assuming that
we do actually want interrupts disabled here.

-- Steve

Signed-off-by: Steven Rostedt <[email protected]>

Index: linux_realtime_goliath/kernel/stop_machine.c
===================================================================
--- linux_realtime_goliath/kernel/stop_machine.c	(revision 295)
+++ linux_realtime_goliath/kernel/stop_machine.c	(working copy)
@@ -40,7 +40,7 @@
 	while (stopmachine_state != STOPMACHINE_EXIT) {
 		if (stopmachine_state == STOPMACHINE_DISABLE_IRQ 
 		    && !irqs_disabled) {
-			local_irq_disable();
+			raw_local_irq_disable();
 			irqs_disabled = 1;
 			/* Ack: irqs disabled. */
 			smp_mb(); /* Must read state first. */
@@ -66,7 +66,7 @@
 	atomic_inc(&stopmachine_thread_ack);
 
 	if (irqs_disabled)
-		local_irq_enable();
+		raw_local_irq_enable();
 	if (prepared)
 		preempt_enable();
 
@@ -120,7 +120,7 @@
 	}
 
 	/* Don't schedule us away at this point, please. */
-	local_irq_disable();
+	raw_local_irq_disable();
 
 	/* Now they are all started, make them hold the CPUs, ready. */
 	stopmachine_set_state(STOPMACHINE_PREPARE);
@@ -134,7 +134,7 @@
 static void restart_machine(void)
 {
 	stopmachine_set_state(STOPMACHINE_EXIT);
-	local_irq_enable();
+	raw_local_irq_enable();
 }
 
 struct stop_machine_data


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux