diff options
| author | Ingo Molnar <mingo@kernel.org> | 2017-06-14 08:31:46 +0300 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2017-06-14 08:31:46 +0300 |
| commit | 10b90ee2eccca042e2d762881dd7119d201f0898 (patch) | |
| tree | 1ebc06bf55a3e33244228d008a2db0197ae2281e /include/linux/cgroup.h | |
| parent | 84bcc1d57f634ba8a55eda9a910c159467af0aac (diff) | |
| parent | 32c1431eea4881a6b17bd7c639315010aeefa452 (diff) | |
| download | linux-10b90ee2eccca042e2d762881dd7119d201f0898.tar.xz | |
Merge tag 'v4.12-rc5' into ras/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/cgroup.h')
| -rw-r--r-- | include/linux/cgroup.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index ed2573e149fa..710a005c6b7a 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -344,6 +344,26 @@ static inline bool css_tryget_online(struct cgroup_subsys_state *css) } /** + * css_is_dying - test whether the specified css is dying + * @css: target css + * + * Test whether @css is in the process of offlining or already offline. In + * most cases, ->css_online() and ->css_offline() callbacks should be + * enough; however, the actual offline operations are RCU delayed and this + * test returns %true also when @css is scheduled to be offlined. + * + * This is useful, for example, when the use case requires synchronous + * behavior with respect to cgroup removal. cgroup removal schedules css + * offlining but the css can seem alive while the operation is being + * delayed. If the delay affects user visible semantics, this test can be + * used to resolve the situation. + */ +static inline bool css_is_dying(struct cgroup_subsys_state *css) +{ + return !(css->flags & CSS_NO_REF) && percpu_ref_is_dying(&css->refcnt); +} + +/** * css_put - put a css reference * @css: target css * |
