Re: [PATCH v2 2/2] writeback: Rework wb_[dec|inc]_stat family of functions

2017-06-20 Thread Nikolay Borisov
On 20.06.2017 23:30, Tejun Heo wrote: > Hello, > > On Tue, Jun 20, 2017 at 11:28:30PM +0300, Nikolay Borisov wrote: >>> Heh, looks like I was confused. __percpu_counter_add() is not >>> irq-safe. It disables preemption and uses __this_cpu_read(), so >>> there's no protection against irq. If

Re: [PATCH v2 2/2] writeback: Rework wb_[dec|inc]_stat family of functions

2017-06-20 Thread Nikolay Borisov
On 20.06.2017 23:30, Tejun Heo wrote: > Hello, > > On Tue, Jun 20, 2017 at 11:28:30PM +0300, Nikolay Borisov wrote: >>> Heh, looks like I was confused. __percpu_counter_add() is not >>> irq-safe. It disables preemption and uses __this_cpu_read(), so >>> there's no protection against irq. If

Re: [PATCH v2 2/2] writeback: Rework wb_[dec|inc]_stat family of functions

2017-06-20 Thread Tejun Heo
Hello, On Tue, Jun 20, 2017 at 11:28:30PM +0300, Nikolay Borisov wrote: > > Heh, looks like I was confused. __percpu_counter_add() is not > > irq-safe. It disables preemption and uses __this_cpu_read(), so > > there's no protection against irq. If writeback statistics want > > irq-safe

Re: [PATCH v2 2/2] writeback: Rework wb_[dec|inc]_stat family of functions

2017-06-20 Thread Tejun Heo
Hello, On Tue, Jun 20, 2017 at 11:28:30PM +0300, Nikolay Borisov wrote: > > Heh, looks like I was confused. __percpu_counter_add() is not > > irq-safe. It disables preemption and uses __this_cpu_read(), so > > there's no protection against irq. If writeback statistics want > > irq-safe

Re: [PATCH v2 2/2] writeback: Rework wb_[dec|inc]_stat family of functions

2017-06-20 Thread Nikolay Borisov
On 20.06.2017 22:37, Tejun Heo wrote: > Hello, Nikolay. > > On Tue, Jun 20, 2017 at 09:02:00PM +0300, Nikolay Borisov wrote: >> Currently the writeback statistics code uses a percpu counters to hold >> various statistics. Furthermore we have 2 families of functions - those which >> disable

Re: [PATCH v2 2/2] writeback: Rework wb_[dec|inc]_stat family of functions

2017-06-20 Thread Nikolay Borisov
On 20.06.2017 22:37, Tejun Heo wrote: > Hello, Nikolay. > > On Tue, Jun 20, 2017 at 09:02:00PM +0300, Nikolay Borisov wrote: >> Currently the writeback statistics code uses a percpu counters to hold >> various statistics. Furthermore we have 2 families of functions - those which >> disable

Re: [PATCH v2 2/2] writeback: Rework wb_[dec|inc]_stat family of functions

2017-06-20 Thread Tejun Heo
Hello, Nikolay. On Tue, Jun 20, 2017 at 09:02:00PM +0300, Nikolay Borisov wrote: > 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

Re: [PATCH v2 2/2] writeback: Rework wb_[dec|inc]_stat family of functions

2017-06-20 Thread Tejun Heo
Hello, Nikolay. On Tue, Jun 20, 2017 at 09:02:00PM +0300, Nikolay Borisov wrote: > 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

[PATCH v2 2/2] writeback: Rework wb_[dec|inc]_stat family of functions

2017-06-20 Thread Nikolay Borisov
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

[PATCH v2 2/2] writeback: Rework wb_[dec|inc]_stat family of functions

2017-06-20 Thread Nikolay Borisov
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