Re: cpu hotplug support broken in 2.6.23-rc3

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

 



Pavel,

On Fri, 2007-09-14 at 14:38 +0200, Pavel Machek wrote:
> > I have an yet untested fix, which preserves the broadcast state across
> > the offline state, but Len is looking into it as well, whether we can
> > just reevaluate the power states (and the broadcast flags) when a cpu
> > becomes online again. If Len can do that easily for 2.6.23, I'd prefer
> > that.
> 
> Is there a patch you want me to test? Or does Len have anything to
> play with?

Venki sent me an initial patch, but it has issues with the notify
ordering. Find below my "cache the broadcast flags" version for testing.

Thanks,

	tglx

---
 kernel/time/tick-broadcast.c |   21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

Index: linux-2.6/kernel/time/tick-broadcast.c
===================================================================
--- linux-2.6.orig/kernel/time/tick-broadcast.c	2007-09-14 13:22:29.000000000 +0200
+++ linux-2.6/kernel/time/tick-broadcast.c	2007-09-14 13:22:29.000000000 +0200
@@ -261,10 +261,25 @@ void tick_broadcast_on_off(unsigned long
 	int cpu = get_cpu();
 
 	if (!cpu_isset(*oncpu, cpu_online_map)) {
-		printk(KERN_ERR "tick-braodcast: ignoring broadcast for "
-		       "offline CPU #%d\n", *oncpu);
-	} else {
+		unsigned long flags;
+
+		spin_lock_irqsave(&tick_broadcast_lock, flags);
+		/*
+		 * We need to cache the broadcast flag for offline
+		 * CPUs. ACPI currently does not reevaluate the
+		 * broadcast flag when a CPU goes online again. Adding
+		 * a cpu notifier to ACPI is probably the correct
+		 * solution, but it is hard to get this correct due to
+		 * notify ordering problems. So caching the flag is
+		 * the safe solution for now.
+		 */
+		if (reason == CLOCK_EVT_NOTIFY_BROADCAST_ON)
+			cpu_set(*oncpu, tick_broadcast_mask);
+		else
+			cpu_clear(*oncpu, tick_broadcast_mask);
 
+		spin_unlock_irqrestore(&tick_broadcast_lock, flags);
+	} else {
 		if (cpu == *oncpu)
 			tick_do_broadcast_on_off(&reason);
 		else


-
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]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux