summaryrefslogtreecommitdiff
path: root/fs/buffer.c
diff options
context:
space:
mode:
authorChristoph Lameter <cl@linux.com>2010-12-06 11:40:05 -0600
committerTejun Heo <tj@kernel.org>2010-12-17 15:18:05 +0100
commitee1be8626355e6a1f3f8c44e2351ff2661c5998d (patch)
treecc7d20969444eb5e3c0541991014ef4fc5332185 /fs/buffer.c
parentcfb824349556904b319464139be5c75fce983b0d (diff)
downloadlinux-3.10-ee1be8626355e6a1f3f8c44e2351ff2661c5998d.tar.gz
linux-3.10-ee1be8626355e6a1f3f8c44e2351ff2661c5998d.tar.bz2
linux-3.10-ee1be8626355e6a1f3f8c44e2351ff2661c5998d.zip
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 <fengguang.wu@intel.com> Cc: Christoph Hellwig <hch@lst.de> Acked-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Christoph Lameter <cl@linux.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'fs/buffer.c')
-rw-r--r--fs/buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index 137d9de00e2..2219a76e2ca 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)