]> err.no Git - linux-2.6/commit
[PATCH] rcu: add a prefetch() in rcu_do_batch()
authorEric Dumazet <dada1@cosmosbay.com>
Thu, 7 Dec 2006 04:38:44 +0000 (20:38 -0800)
committerLinus Torvalds <torvalds@woody.osdl.org>
Thu, 7 Dec 2006 16:39:40 +0000 (08:39 -0800)
commit1c69d921ed9cc6593ad4f60c0f9951cb0d62b0b4
tree669149c112fd917d68a301b2bcceae681af17a1c
parent9a0efbb8795e8c5acb279d984b53d6af6ecdd00f
[PATCH] rcu: add a prefetch() in rcu_do_batch()

On some workloads, (for example when lot of close() syscalls are done), RCU
qlen can be quite large, and RCU heads are no longer in cpu cache when
rcu_do_batch() is called.

This patch adds a prefetch() in rcu_do_batch() to give CPU a hint to bring
back cache lines containing 'struct rcu_head's.

Most list manipulations macros include prefetch(), but not open coded ones
(at least with current C compilers :) )

I got a nice speedup on a trivial benchmark (3.48 us per iteration instead
of 3.95 us on a 1.6 GHz Pentium-M)

while (1) { pipe(p); close(fd[0]); close(fd[1]);}

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/rcupdate.c