From: Christoph Lameter Date: Mon, 6 Dec 2010 17:40:05 +0000 (-0600) Subject: fs: Use this_cpu_inc_return in buffer.c X-Git-Tag: v2.6.38-rc1~455^2~12 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee1be8626355e6a1f3f8c44e2351ff2661c5998d;p=pandora-kernel.git fs: Use this_cpu_inc_return in buffer.c __this_cpu_inc can create a single instruction with the same effect as the _get_cpu_var(..)++ construct in buffer.c. Cc: Wu Fengguang Cc: Christoph Hellwig Acked-by: H. Peter Anvin Signed-off-by: Christoph Lameter Signed-off-by: Tejun Heo --- diff --git a/fs/buffer.c b/fs/buffer.c index 137d9de00e24..2219a76e2caf 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -3201,7 +3201,7 @@ static void recalc_bh_state(void) int i; int tot = 0; - if (__get_cpu_var(bh_accounting).ratelimit++ < 4096) + if (__this_cpu_inc_return(bh_accounting.ratelimit) - 1 < 4096) return; __this_cpu_write(bh_accounting.ratelimit, 0); for_each_online_cpu(i)