lkml.org 
[lkml]   [2006]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [RFC/PATCH] Make powerpc64 use __thread for per-cpu variables
    From
    From: Richard Henderson <rth@twiddle.net>
    Date: Wed, 10 May 2006 08:47:13 -0700

    > How do you plan to address the compiler optimizing
    ...
    > Across the schedule, we may have changed cpus, making the cached
    > address invalid.

    Per-cpu variables need to be accessed only with preemption
    disabled. And the preemption enable/disable operations
    provide a compiler memory barrier.

    #define preempt_disable() \
    do { \
    inc_preempt_count(); \
    barrier(); \
    } while (0)

    ...

    #define preempt_enable() \
    do { \
    preempt_enable_no_resched(); \
    barrier(); \
    preempt_check_resched(); \
    } while (0)

    The scheduler itself need to take care to not cause the situation
    you mention either.

    Therefore this is an issue we had already, not some new thing
    introduced by using __thread for per-cpu variables.
    -
    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-05-10 21:43    [W:2.919 / U:0.296 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site