• Eric Dumazet's avatar
    [PATCH] rcu: add a prefetch() in rcu_do_batch() · 1c69d921
    Eric Dumazet authored
    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: default avatarEric Dumazet <dada1@cosmosbay.com>
    Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    1c69d921
rcupdate.c 17.4 KB