Thread (6 messages) 6 messages, 3 authors, 2012-11-02

Re: [PATCH 4/9] net: openvswitch: use this_cpu_ptr per-cpu helper

flat view

From: Christoph Lameter <hidden>
Date: 2012-11-02 14:01:16
Also in: lkml

On Thu, 1 Nov 2012, Jesse Gross wrote:
On Thu, Nov 1, 2012 at 7:33 AM, Christoph Lameter [off-list ref] wrote:
quoted
On Thu, 1 Nov 2012, Shan Wei wrote:
quoted
But for different field in same per-cpu variable, how to guarantee n_missed
and n_hit are from same cpu?
this_cpu_read(dp->stats_percpu->n_missed);
[processor changed]
this_cpu_read(dp->stats_percpu->n_hit);
What does current guarantee that? If it is guaranteed then you can use the
__this_cpu_xxx ops.
Preemption is disabled in all of the places where writes are done and
all of the reads are from foreign CPUs.
Since preemption is disabled no processor change can occur. So its safe to
use __this_cpu ops throughout and they will operate on the current per cpu
area.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help