From: Zefan Li <lizefan@huawei.com>
To: Tejun Heo <tj@kernel.org>
Cc: <cgroups@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH cgroup/for-3.19 3/3] cgroup: fix the async css offline wait logic in cgroup_subtree_control_write()
Date: Tue, 18 Nov 2014 14:30:44 +0800 [thread overview]
Message-ID: <546AE794.5070902@huawei.com> (raw)
In-Reply-To: <20141113215921.GC2598@htj.dyndns.org>
On 2014/11/14 5:59, Tejun Heo wrote:
> When a subsystem is offlined, its entry on @cgrp->subsys[] is cleared
> asynchronously. If cgroup_subtree_control_write() is requested to
> enable the subsystem again before the entry is cleared, it has to wait
> for the previous offlining to finish and clear the @cgrp->subsys[]
> entry before trying to enable the subsystem again.
>
> This is currently done while verifying the input enable / disable
> parameters. This used to be correct but f63070d350e3 ("cgroup: make
> interface files visible iff enabled on cgroup->subtree_control")
> breaks it. The commit is one of the commits implementing subsystem
> dependency.
>
> Through subsystem dependency, some subsystems may be enabled and
> disabled implicitly in addition to the explicitly requested ones. The
> actual subsystems to be enabled and disabled are determined during
> @css_enable/disable calculation. The current offline wait logic skips
> the ones which are already implicitly enabled and then waits for
> subsystems in @enable; however, this misses the subsystems which may
> be implicitly enabled through dependency from @enable. If such
> implicitly subsystem hasn't yet finished offlining yet, the function
> ends up trying to create a css when its @cgrp->subsys[] slot is
> already occupied triggering BUG_ON() in init_and_link_css().
>
> Fix it by moving the wait logic after @css_enable is calculated and
> waiting for all the subsystems in @css_enable. This fixes the above
> bug as the mask contains all subsystems which are to be enabled
> including the ones enabled through dependencies.
>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Fixes: f63070d350e3 ("cgroup: make interface files visible iff enabled on cgroup->subtree_control")
For all 3 patches:
Acked-by: Zefan Li <lizefan@huawei.com>
next prev parent reply other threads:[~2014-11-18 6:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-13 21:58 [PATCH cgroup/for-3.19 1/3] cgroup: separate out cgroup_calc_child_subsys_mask() from cgroup_refresh_child_subsys_mask() Tejun Heo
2014-11-13 21:58 ` [PATCH cgroup/for-3.19 2/3] cgroup: restructure child_subsys_mask handling in cgroup_subtree_control_write() Tejun Heo
2014-11-13 21:59 ` [PATCH cgroup/for-3.19 3/3] cgroup: fix the async css offline wait logic " Tejun Heo
2014-11-18 6:30 ` Zefan Li [this message]
2014-11-18 7:50 ` Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=546AE794.5070902@huawei.com \
--to=lizefan@huawei.com \
--cc=cgroups@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox