Nikolay Borisov 3e8f399da4 writeback: rework wb_[dec|inc]_stat family of functions
Currently the writeback statistics code uses a percpu counters to hold
various statistics.  Furthermore we have 2 families of functions - those
which disable local irq and those which doesn't and whose names begin
with double underscore.  However, they both end up calling
__add_wb_stats which in turn calls percpu_counter_add_batch which is
already irq-safe.

Exploiting this fact allows to eliminated the __wb_* functions since
they don't add any further protection than we already have.
Furthermore, refactor the wb_* function to call __add_wb_stat directly
without the irq-disabling dance.  This will likely result in better
runtime of code which deals with modifying the stat counters.

While at it also document why percpu_counter_add_batch is in fact
preempt and irq-safe since at least 3 people got confused.

Link: http://lkml.kernel.org/r/1498029937-27293-1-git-send-email-nborisov@suse.com
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Acked-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Josef Bacik <jbacik@fb.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-07-12 16:26:05 -07:00
..
2017-02-24 17:46:57 -08:00
2011-03-11 14:25:50 +00:00
2015-11-23 09:44:58 +01:00
2017-03-30 09:37:20 +02:00
2011-10-29 21:20:22 +02:00
2017-06-09 11:52:07 +02:00
2017-02-24 17:46:57 -08:00
2017-05-09 15:40:28 -07:00
2014-04-30 19:49:37 +01:00
2017-02-24 17:46:57 -08:00
2017-02-13 21:44:10 -05:00
2017-07-07 09:44:06 -07:00
2014-08-08 15:57:25 -07:00
2012-07-30 17:25:16 -07:00
2014-06-25 17:45:43 -07:00
2016-12-06 10:17:03 +02:00
2015-09-08 14:35:59 -07:00
2017-02-24 17:46:57 -08:00
2015-03-23 22:12:08 -04:00
2017-05-15 23:40:22 -04:00
2016-08-02 17:31:41 -04:00
2017-07-07 10:37:54 -07:00