lkml.org 
[lkml]   [2013]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [gcv v3 06/35] scheduler: Replace __get_cpu_var uses

* Peter Zijlstra <peterz@infradead.org> wrote:

> On Wed, Aug 28, 2013 at 07:48:14PM +0000, Christoph Lameter wrote:
> > Transformations done to __get_cpu_var()
> >
> >
> > 1. Determine the address of the percpu instance of the current processor.
> >
> > DEFINE_PER_CPU(int, y);
> > int *x = &__get_cpu_var(y);
> >
> > Converts to
> >
> > int *x = this_cpu_ptr(&y);
> >
> >
> > 2. Same as #1 but this time an array structure is involved.
> >
> > DEFINE_PER_CPU(int, y[20]);
> > int *x = __get_cpu_var(y);
> >
> > Converts to
> >
> > int *x = this_cpu_ptr(y);
> >
> >
> > 3. Retrieve the content of the current processors instance of a per cpu variable.
> >
> > DEFINE_PER_CPU(int, u);
> > int x = __get_cpu_var(y)
> >
> > Converts to
> >
> > int x = __this_cpu_read(y);
> >
>
> This looses a preemption debug check, so NAK
>
> > 4. Retrieve the content of a percpu struct
> >
> > DEFINE_PER_CPU(struct mystruct, y);
> > struct mystruct x = __get_cpu_var(y);
> >
> > Converts to
> >
> > memcpy(this_cpu_ptr(&x), y, sizeof(x));
> >
> > 5. Assignment to a per cpu variable
> >
> > DEFINE_PER_CPU(int, y)
> > __get_cpu_var(y) = x;
> >
> > Converts to
> >
> > this_cpu_write(y, x);
> >
>
> This too looses a preemption debug check, NAK
>
> > 6. Increment/Decrement etc of a per cpu variable
> >
> > DEFINE_PER_CPU(int, y);
> > __get_cpu_var(y)++
> >
> > Converts to
> >
> > this_cpu_inc(y)
> >
>
> Lo and behold.. no preemption checks again.
>
>
> Seriously first fix the debug and validation bits of the *this_cpu*
> stuff.

Note that most of the other 'gcv' patches have these problems as well, so
it's a NAK from me as well for most of the other patches as well ...

Thanks,

Ingo


\
 
 \ /
  Last update: 2013-08-29 14:01    [W:0.078 / U:2.732 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site