lkml.org 
[lkml]   [2008]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[patch 29/41] x86_64: Use CPU ops for nmi alert counter
    These are critical fast paths. Reduce overhead by using a segment override
    instead of an address calculation.

    Signed-off-by: Christoph LAmeter <clameter@sgi.com>
    ---
    arch/x86/kernel/nmi_64.c | 8 ++++----
    1 file changed, 4 insertions(+), 4 deletions(-)

    Index: linux-2.6/arch/x86/kernel/nmi_64.c
    ===================================================================
    --- linux-2.6.orig/arch/x86/kernel/nmi_64.c 2008-04-29 14:55:48.000000000 -0700
    +++ linux-2.6/arch/x86/kernel/nmi_64.c 2008-05-21 22:49:33.000000000 -0700
    @@ -290,7 +290,7 @@
    */

    static DEFINE_PER_CPU(unsigned, last_irq_sum);
    -static DEFINE_PER_CPU(local_t, alert_counter);
    +static DEFINE_PER_CPU(int, alert_counter);
    static DEFINE_PER_CPU(int, nmi_touch);

    void touch_nmi_watchdog(void)
    @@ -356,13 +356,13 @@
    * Ayiee, looks like this CPU is stuck ...
    * wait a few IRQs (5 seconds) before doing the oops ...
    */
    - local_inc(&__get_cpu_var(alert_counter));
    - if (local_read(&__get_cpu_var(alert_counter)) == 5*nmi_hz)
    + CPU_INC(per_cpu_var(alert_counter));
    + if (CPU_READ(per_cpu_var(alert_counter)) == 5*nmi_hz)
    die_nmi("NMI Watchdog detected LOCKUP on CPU %d\n", regs,
    panic_on_timeout);
    } else {
    __get_cpu_var(last_irq_sum) = sum;
    - local_set(&__get_cpu_var(alert_counter), 0);
    + CPU_WRITE(per_cpu_var(alert_counter), 0);
    }

    /* see if the nmi watchdog went off */
    --


    \
     
     \ /
      Last update: 2008-05-30 06:11    [W:0.021 / U:0.112 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site