lkml.org 
[lkml]   [2013]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [PATCH 6/6] percpu: Add preemption checks to __this_cpu ops
    On Thu, Oct 17, 2013 at 07:22:12PM +0000, Christoph Lameter wrote:
    > On Wed, 16 Oct 2013, Peter Zijlstra wrote:
    > > diff --git a/arch/x86/include/asm/preempt.h b/arch/x86/include/asm/preempt.h
    > > index 8729723..95e3532 100644
    > > --- a/arch/x86/include/asm/preempt.h
    > > +++ b/arch/x86/include/asm/preempt.h
    > > @@ -13,12 +13,12 @@ DECLARE_PER_CPU(int, __preempt_count);
    > > */
    > > static __always_inline int preempt_count(void)
    > > {
    > > - return __this_cpu_read_4(__preempt_count) & ~PREEMPT_NEED_RESCHED;
    > > + return raw_cpu_read_4(__preempt_count) & ~PREEMPT_NEED_RESCHED;
    > > }
    > >
    > > static __always_inline void preempt_count_set(int pc)
    > > {
    > > - __this_cpu_write_4(__preempt_count, pc);
    > > + raw_cpu_write_4(__preempt_count, pc);
    > > }
    >
    > Huh? What happened here? Why do we use the __this_cpu_read_4 here?
    > This should be just raw_cpu_write()

    Header inclusion hell; I could only easily get away with including
    asm/percpu.h, so I had to use the _4 stuff.


    \
     
     \ /
      Last update: 2013-10-18 04:21    [W:3.419 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site