]> git.baikalelectronics.ru Git - kernel.git/commit
percpu-refcount: support synchronous switch to atomic mode.
authorNeilBrown <neilb@suse.com>
Wed, 15 Mar 2017 03:05:14 +0000 (14:05 +1100)
committerShaohua Li <shli@fb.com>
Thu, 23 Mar 2017 02:18:43 +0000 (19:18 -0700)
commitc838bed7708dcd893a8eae14db24a2799ba9e29a
treeb039d920dc1bef971d419a06cee4c7544fec4afd
parent235135cbc52f4442514903269ed2cce998d57766
percpu-refcount: support synchronous switch to atomic mode.

percpu_ref_switch_to_atomic_sync() schedules the switch to atomic mode, then
waits for it to complete.

Also export percpu_ref_switch_to_* so they can be used from modules.

This will be used in md/raid to count the number of pending write
requests to an array.
We occasionally need to check if the count is zero, but most often
we don't care.
We always want updates to the counter to be fast, as in some cases
we count every 4K page.

Signed-off-by: NeilBrown <neilb@suse.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Shaohua Li <shli@fb.com>
include/linux/percpu-refcount.h
lib/percpu-refcount.c