diff options
| author | Sean Paul <seanpaul@chromium.org> | 2017-07-17 18:43:05 +0300 |
|---|---|---|
| committer | Sean Paul <seanpaul@chromium.org> | 2017-07-17 18:56:07 +0300 |
| commit | ef434a0c2ce765ad33026375db7d23aebd5e9532 (patch) | |
| tree | 4bdac59f0bac3a6508741e6bd62da6e770fc3bc1 /include/linux/cgroup.h | |
| parent | 76250f2b743b72cb685cc51ac0cdabb32957180b (diff) | |
| parent | 1ed134e6526b1b513a14fba938f6d96aa1c7f3dd (diff) | |
| download | linux-ef434a0c2ce765ad33026375db7d23aebd5e9532.tar.xz | |
Merge branch 'drm-misc-next-fixes' into drm-misc-fixes
Pick up
1ed134e6526b drm/vc4: Fix VBLANK handling in crtc->enable() path
From drm-misc-next-fixes, it was applied after the last pull request
was sent from that branch. We'll send it through drm-fixes instead.
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 * |
