summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolay Borisov <nborisov@suse.com>2017-07-11 00:49:35 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-11 01:32:32 +0200
commite3d3910a57ab9c70cddb2522ae711ff9bff89e7c (patch)
treef2cf3cfe2f3beea8840e918501568de106ccff2a
parentinclude/linux/mmzone.h: remove ancient/ambiguous comment (diff)
downloadlinux-e3d3910a57ab9c70cddb2522ae711ff9bff89e7c.tar.xz
linux-e3d3910a57ab9c70cddb2522ae711ff9bff89e7c.zip
include/linux/backing-dev.h: simplify wb_stat_sum
wb_stat_sum() disables interrupts and calls __wb_stat_sum() which eventually calls __percpu_counter_sum(). However, the percpu routine is already irq-safe. Simplify the code a bit by making wb_stat_sum() directly call percpu_counter_sum_positive() and not disable interrupts. Also remove the now-uneeded __wb_stat_sum() which was just a wrapper over percpu_counter_sum_positive(). Link: http://lkml.kernel.org/r/1498230681-29103-1-git-send-email-nborisov@suse.com Signed-off-by: Nikolay Borisov <nborisov@suse.com> Acked-by: Peter Zijlstra <peterz@infradead.org> Cc: Tejun Heo <tj@kernel.org> Cc: Jan Kara <jack@suse.cz> Cc: Jens Axboe <axboe@fb.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/backing-dev.h15
1 files changed, 1 insertions, 14 deletions
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index ace73f96eb1e..334165c911f0 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -104,22 +104,9 @@ static inline s64 wb_stat(struct bdi_writeback *wb, enum wb_stat_item item)
return percpu_counter_read_positive(&wb->stat[item]);
}
-static inline s64 __wb_stat_sum(struct bdi_writeback *wb,
- enum wb_stat_item item)
-{
- return percpu_counter_sum_positive(&wb->stat[item]);
-}
-
static inline s64 wb_stat_sum(struct bdi_writeback *wb, enum wb_stat_item item)
{
- s64 sum;
- unsigned long flags;
-
- local_irq_save(flags);
- sum = __wb_stat_sum(wb, item);
- local_irq_restore(flags);
-
- return sum;
+ return percpu_counter_sum_positive(&wb->stat[item]);
}
extern void wb_writeout_inc(struct bdi_writeback *wb);