diff options
author | Roman Gushchin | 2019-05-07 19:01:47 +0200 |
---|---|---|
committer | Dennis Zhou | 2019-05-09 19:49:47 +0200 |
commit | 09ed79d6d75f06cc963a78f25463251b0a758dc7 (patch) | |
tree | 379de15651feaf475945ab05fca4d6acd69ba32e /fs/efs | |
parent | Linux 5.1 (diff) | |
download | kernel-qcow2-linux-09ed79d6d75f06cc963a78f25463251b0a758dc7.tar.gz kernel-qcow2-linux-09ed79d6d75f06cc963a78f25463251b0a758dc7.tar.xz kernel-qcow2-linux-09ed79d6d75f06cc963a78f25463251b0a758dc7.zip |
percpu_ref: introduce PERCPU_REF_ALLOW_REINIT flag
In most cases percpu reference counters are not switched to the
percpu mode after they reach the atomic mode. Some obvious exceptions
are reference counters which are initialized into the atomic
mode (using PERCPU_REF_INIT_ATOMIC and PERCPU_REF_INIT_DEAD flags),
and there are few other exceptions.
But in most cases there is no way back, and once the reference counter
is switched to the atomic mode, there is no reason to wait for
percpu_ref_exit() to release the percpu memory. Of course, the size
of a single counter is not so big, but because it can pin the whole
percpu block in memory, the memory footprint can be noticeable
(e.g. on my 32 CPUs machine a percpu block is 8Mb large).
To make releasing of the percpu memory as early as possible, let's
introduce the PERCPU_REF_ALLOW_REINIT flag with the following semantics:
it has to be set in order to switch a percpu reference counter to the
percpu mode after the initialization. PERCPU_REF_INIT_ATOMIC and
PERCPU_REF_INIT_DEAD flags will implicitly assume PERCPU_REF_ALLOW_REINIT.
This patch doesn't introduce any functional change to avoid any
regressions. It will be done later in the patchset after adjusting
all call sites, which are reviving percpu counters.
Signed-off-by: Roman Gushchin <guro@fb.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Dennis Zhou <dennis@kernel.org>
Diffstat (limited to 'fs/efs')
0 files changed, 0 insertions, 0 deletions