diff options
author | 2010-12-14 10:28:47 -0600 | |
---|---|---|
committer | 2010-12-18 15:54:04 +0100 | |
commit | 8270137a0d50507a5b40f880db636527045b8466 (patch) | |
tree | 3490a31fcbea09ab5fffb6b2f4330dc92896f413 /fs/jbd2/commit.c | |
parent | x86: this_cpu_cmpxchg and this_cpu_xchg operations (diff) | |
download | linux-rng-8270137a0d50507a5b40f880db636527045b8466.tar.xz linux-rng-8270137a0d50507a5b40f880db636527045b8466.zip |
cpuops: Use cmpxchg for xchg to avoid lock semantics
Use cmpxchg instead of xchg to realize this_cpu_xchg.
xchg will cause LOCK overhead since LOCK is always implied but cmpxchg
will not.
Baselines:
xchg() = 18 cycles (no segment prefix, LOCK semantics)
__this_cpu_xchg = 1 cycle
(simulated using this_cpu_read/write, two prefixes. Looks like the
cpu can use loop optimization to get rid of most of the overhead)
Cycles before:
this_cpu_xchg = 37 cycles (segment prefix and LOCK (implied by xchg))
After:
this_cpu_xchg = 11 cycle (using cmpxchg without lock semantics)
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'fs/jbd2/commit.c')
0 files changed, 0 insertions, 0 deletions