Re: [PATCH] core: fix the use of this_cpu_ptr
From: Christoph Lameter <hidden>
Date: 2013-03-28 16:51:45
From: Christoph Lameter <hidden>
Date: 2013-03-28 16:51:45
On Thu, 28 Mar 2013, Eric Dumazet wrote:
On Thu, 2013-03-28 at 14:38 +0000, Christoph Lameter wrote:quoted
On Thu, 28 Mar 2013, Eric Dumazet wrote:quoted
quoted
Christoph, could this kind of error be detected by the compiler or sparse ?The per cpu variables are marked with __percpu. This should be detected by sparse.make C=2 net/core/flow.o CHECK net/core/flow.c No warning.
huh?
this_cpu_ptr uses SHIFT_PERCPU_PTR
#ifndef SHIFT_PERCPU_PTR
/* Weird cast keeps both GCC and sparse happy. */
#define SHIFT_PERCPU_PTR(__p, __offset) ({ \
__verify_pcpu_ptr((__p)); \
RELOC_HIDE((typeof(*(__p)) __kernel __force *)(__p), (__offset));
\
})
#endif
This would mean that __verify_pcpu_ptr is broken.