lkml.org 
[lkml]   [2006]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [patch 18/23] dynticks: i386 arch code
    On Fri, 29 Sep 2006 23:58:37 -0000
    Thomas Gleixner <tglx@linutronix.de> wrote:

    > From: Ingo Molnar <mingo@elte.hu>
    >
    > prepare i386 for dyntick: idle handler callbacks and IRQ callback.
    >
    > Index: linux-2.6.18-mm2/arch/i386/kernel/nmi.c
    > ===================================================================
    > --- linux-2.6.18-mm2.orig/arch/i386/kernel/nmi.c 2006-09-30 01:41:10.000000000 +0200
    > +++ linux-2.6.18-mm2/arch/i386/kernel/nmi.c 2006-09-30 01:41:19.000000000 +0200
    > @@ -20,6 +20,7 @@
    > #include <linux/sysdev.h>
    > #include <linux/sysctl.h>
    > #include <linux/percpu.h>
    > +#include <linux/kernel_stat.h>
    > #include <linux/dmi.h>
    > #include <linux/kprobes.h>
    >
    > @@ -908,7 +909,7 @@ __kprobes int nmi_watchdog_tick(struct p
    > touched = 1;
    > }
    >
    > - sum = per_cpu(irq_stat, cpu).apic_timer_irqs;
    > + sum = per_cpu(irq_stat, cpu).apic_timer_irqs + kstat_irqs(0);

    Why?

    > ===================================================================
    > --- linux-2.6.18-mm2.orig/arch/i386/kernel/process.c 2006-09-30 01:41:10.000000000 +0200
    > +++ linux-2.6.18-mm2/arch/i386/kernel/process.c 2006-09-30 01:41:19.000000000 +0200
    > @@ -178,24 +178,27 @@ void cpu_idle(void)
    >
    > /* endless idle loop with no priority at all */
    > while (1) {
    > - while (!need_resched()) {
    > - void (*idle)(void);
    > + if (!hrtimer_stop_sched_tick()) {
    > + while (!need_resched()) {

    I don't see why hrtimer_stop_sched_tick() returns need_resched(). We
    immediately reevaluate it anyway. hrtimer_stop_sched_tick() could return 1.

    > + void (*idle)(void);
    >
    > - if (__get_cpu_var(cpu_idle_state))
    > - __get_cpu_var(cpu_idle_state) = 0;
    > + if (__get_cpu_var(cpu_idle_state))
    > + __get_cpu_var(cpu_idle_state) = 0;
    >
    > - rmb();
    > - idle = pm_idle;
    > + rmb();
    > + idle = pm_idle;
    >
    > - if (!idle)
    > - idle = default_idle;
    > + if (!idle)
    > + idle = default_idle;
    >
    > - if (cpu_is_offline(cpu))
    > - play_dead();
    > + if (cpu_is_offline(cpu))
    > + play_dead();
    >
    > - __get_cpu_var(irq_stat).idle_timestamp = jiffies;
    > - idle();
    > + __get_cpu_var(irq_stat).idle_timestamp = jiffies;
    > + idle();
    > + }
    > }
    > + hrtimer_restart_sched_tick();
    > preempt_enable_no_resched();
    > schedule();
    > preempt_disable();
    >

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

    \
     
     \ /
      Last update: 2006-09-30 10:49    [W:0.024 / U:30.404 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site