]> Git Repo - linux.git/commit
lib/percpu_counter.c: fix __percpu_counter_add()
authorMing Lei <[email protected]>
Wed, 15 Jan 2014 01:56:42 +0000 (17:56 -0800)
committerLinus Torvalds <[email protected]>
Wed, 15 Jan 2014 07:19:42 +0000 (14:19 +0700)
commit74e72f894d56eb9d2e1218530c658e7d297e002b
treeb8fe55badb0f3edc43a68576823ffad76f5e5770
parent5a610fcc7390ee60308deaf09426ada87a1eeec2
lib/percpu_counter.c: fix __percpu_counter_add()

__percpu_counter_add() may be called in softirq/hardirq handler (such
as, blk_mq_queue_exit() is typically called in hardirq/softirq handler),
so we need to call this_cpu_add()(irq safe helper) to update percpu
counter, otherwise counts may be lost.

This fixes the problem that 'rmmod null_blk' hangs in blk_cleanup_queue()
because of miscounting of request_queue->mq_usage_counter.

This patch is the v1 of previous one of "lib/percpu_counter.c:
disable local irq when updating percpu couter", and takes Andrew's
approach which may be more efficient for ARCHs(x86, s390) that
have optimized this_cpu_add().

Signed-off-by: Ming Lei <[email protected]>
Cc: Paul Gortmaker <[email protected]>
Cc: Shaohua Li <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: Fan Du <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
lib/percpu_counter.c
This page took 0.052071 seconds and 4 git commands to generate.