lkml.org 
[lkml]   [2009]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [PATCH] Fix dirty page accounting in redirty_page_for_writepage()

    * Christoph Lameter <cl@linux.com> wrote:

    > On Thu, 30 Apr 2009, Ingo Molnar wrote:
    >
    > > it's all done, implemented and upstream already. You are a bit late
    > > to the party ;-)
    >
    > Just looked over it. Yep, now we just need to fix the things that
    > were messed up.

    Could we please skip over the lengthy flamewar and bad-mouthing of
    other people's work and go straight to the constructive portion of
    the discussion? ;-)

    The patch below makes the fallback/slowpath irq safe.

    Ingo

    diff --git a/include/linux/percpu.h b/include/linux/percpu.h
    index 1581ff2..6b3984a 100644
    --- a/include/linux/percpu.h
    +++ b/include/linux/percpu.h
    @@ -139,17 +139,23 @@ static inline void free_percpu(void *p)
    #ifndef percpu_read
    # define percpu_read(var) \
    ({ \
    + unsigned long flags; \
    typeof(per_cpu_var(var)) __tmp_var__; \
    - __tmp_var__ = get_cpu_var(var); \
    - put_cpu_var(var); \
    + \
    + local_irq_save(flags); \
    + __tmp_var__ = __get_cpu_var(var); \
    + local_irq_restore(flags); \
    __tmp_var__; \
    })
    #endif

    #define __percpu_generic_to_op(var, val, op) \
    do { \
    - get_cpu_var(var) op val; \
    - put_cpu_var(var); \
    + unsigned long flags; \
    + \
    + local_irq_save(flags); \
    + op val; \
    + local_irq_restore(flags); \
    } while (0)

    #ifndef percpu_write

    \
     
     \ /
      Last update: 2009-04-30 16:19    [W:0.025 / U:151.396 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site