On Mon, Aug 26, 2013 at 08:44:40PM +0000, Christoph Lameter wrote:
> __get_cpu_var() is used for multiple purposes in the kernel source. One of 
> them is
> address calculation via the form &__get_cpu_var(x). This calculates the 
> address for
> the instance of the percpu variable of the current processor based on an 
> offset.


> 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(&y), x, sizeof(x));

That's wrong (destination and source should be exchanged).
However your patch looks good.

Acked-by: Heiko Carstens <[email protected]>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to