提交 ee1be862 编写于 作者: C Christoph Lameter 提交者: Tejun Heo

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: NH. Peter Anvin <hpa@zytor.com>
Signed-off-by: NChristoph Lameter <cl@linux.com>
Signed-off-by: NTejun Heo <tj@kernel.org>
上级 cfb82434
...@@ -3201,7 +3201,7 @@ static void recalc_bh_state(void) ...@@ -3201,7 +3201,7 @@ static void recalc_bh_state(void)
int i; int i;
int tot = 0; int tot = 0;
if (__get_cpu_var(bh_accounting).ratelimit++ < 4096) if (__this_cpu_inc_return(bh_accounting.ratelimit) - 1 < 4096)
return; return;
__this_cpu_write(bh_accounting.ratelimit, 0); __this_cpu_write(bh_accounting.ratelimit, 0);
for_each_online_cpu(i) for_each_online_cpu(i)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册