summaryrefslogtreecommitdiff
path: root/lib/rational.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2015-09-30 00:47:18 +0300
committerTejun Heo <tj@kernel.org>2016-08-10 22:02:58 +0300
commit18808354b79622ed11857e41f9044ba17aec5b01 (patch)
tree44f91394a6c0385b30e5271432ff0300cc17ef83 /lib/rational.c
parentb2302c7fdc654d249c546aac6228b8e10969bc1e (diff)
downloadlinux-18808354b79622ed11857e41f9044ba17aec5b01.tar.xz
percpu_ref: unify staggered atomic switching wait behavior
When an atomic or percpu switching starts before the previous atomic switching finishes, the taken behaviors are * If the new atomic switching has confirmation callback, it waits for the previous atomic switching to complete. * If the new percpu switching is the first percpu switching following the previous atomic switching, it waits the previous atomic switching to complete. No percpu_ref user depends on these subtleties. The only meaningful part is that, if the caller ensures that atomic switching isn't in progress, mode switching operations can be issued from any context. This patch pulls the wait logic to the top of both switching functions so that they always wait for the previous atomic switching to complete. This makes the behavior simpler and consistent for both directions and will help allowing concurrent invocations of mode switching functions. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'lib/rational.c')
0 files changed, 0 insertions, 0 deletions