Re: linux-next: Tree for June 13: IO APIC breakage on HP nx6325

From: Rafael J. Wysocki
Date: Tue Jun 17 2008 - 18:18:43 EST


On Tuesday, 17 of June 2008, Rafael J. Wysocki wrote:
> On Tuesday, 17 of June 2008, Thomas Gleixner wrote:
> > On Tue, 17 Jun 2008, Rafael J. Wysocki wrote:
> > >
> > > BTW, with the C1E patches reverted I don't get the
> > > WARNING: at /home/rafael/src/linux-next/kernel/smp.c:215 smp_call_function_single+0x3d/0xa2
> > > in the log. Thomas?
> >
> > Yeah, my bad. Fix below.
>
> Thanks, it eliminates the WARNING, but still the box doesn't work with
> the "x86: add C1E aware idle function" patch applied, even with 'highres=off'.
>
> The main symptom is that CPU loads are computed incorrectly (I got X using 126%
> of CPU time from 'top', for example). Apart from this, some processes (like
> gkrellm) seem to be 'frozen' and only change their state in 'jumps', as though
> they only got CPU from time to time at random.
>
> Reverting the above-mentioned patch fixes those problems.

Ah. If your fix is replaced with the appended one, the system happily works
with C1E and highres.

Thanks,
Rafael


---
arch/x86/kernel/process.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)

Index: linux-next/arch/x86/kernel/process.c
===================================================================
--- linux-next.orig/arch/x86/kernel/process.c
+++ linux-next/arch/x86/kernel/process.c
@@ -265,16 +265,30 @@ static void c1e_idle(void)
if (c1e_detected) {
int cpu = smp_processor_id();

+ local_irq_enable();
+
if (!cpu_isset(cpu, c1e_mask)) {
cpu_set(cpu, c1e_mask);
- /* Force broadcast so ACPI can not interfere */
+ /*
+ * Force broadcast so ACPI can not interfere. Needs
+ * to run with interrupts enabled as it uses
+ * smp_function_call.
+ */
clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_FORCE,
&cpu);
printk(KERN_INFO "Switch to broadcast mode on CPU%d\n",
cpu);
}
+ local_irq_disable();
clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu);
+ local_irq_enable();
+
default_idle();
+
+ /*
+ * The switch back from broadcast mode needs to be
+ * called with interrupts disabled.
+ */
local_irq_disable();
clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu);
local_irq_enable();
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/