From: Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: Re: [PATCH v2 cgroup 1/2] cgroup: move module ref handling into rebind_subsystems()
Date: Mon, 15 Jul 2013 10:54:18 +0800 [thread overview]
Message-ID: <51E3645A.6080404@huawei.com> (raw)
In-Reply-To: <20130712203817.GI23680-9pTldWuhBndy/B6EtB590w@public.gmane.org>
On 2013/7/13 4:38, Tejun Heo wrote:
> Module ref handling in cgroup is rather weird.
> parse_cgroupfs_options() grabs all the modules for the specified
> subsystems. A module ref is kept if the specified subsystem is newly
> bound to the hierarchy. If not, or the operation fails, the refs are
> dropped. This scatters module ref handling across multiple functions
> making it difficult to track. It also make the function nasty to use
> for dynamic subsystem binding which is necessary for the planned
> unified hierarchy.
>
> There's nothing which requires the subsystem modules to be pinned
> between parse_cgroupfs_options() and rebind_subsystems() in both mount
> and remount paths. parse_cgroupfs_options() can just parse and
> rebind_subsystems() can handle pinning the subsystems that it wants to
> bind, which is a natural part of its task - binding - anyway.
>
> Move module ref handling into rebind_subsystems() which makes the code
> a lot simpler - modules are gotten iff it's gonna be bound and put iff
> unbound or binding fails.
>
> v2: Li pointed out that if a controller module is unloaded between
> parsing and binding, rebind_subsystems() won't notice the missing
> controller as it only iterates through existing controllers. Fix
> it by updating rebind_subsystems() to compare @added_mask to
> @pinned and fail with -ENOENT if they don't match.
>
> Signed-off-by: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Cc: Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Acked-by: Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
next prev parent reply other threads:[~2013-07-15 2:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-29 4:12 [PATCH cgroup 1/2] cgroup: move module ref handling into rebind_subsystems() Tejun Heo
[not found] ` <20130629041231.GA31353-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2013-06-29 4:13 ` [PATCH 2/2] cgroup: remove gratuituous BUG_ON()s from rebind_subsystems() Tejun Heo
[not found] ` <20130629041305.GB31353-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2013-07-15 2:54 ` Li Zefan
2013-06-29 4:13 ` Tejun Heo
2013-07-12 9:03 ` [PATCH cgroup 1/2] cgroup: move module ref handling into rebind_subsystems() Li Zefan
[not found] ` <51DFC650.9010801-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2013-07-12 9:08 ` Li Zefan
[not found] ` <51DFC787.7080703-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2013-07-12 20:10 ` Tejun Heo
2013-07-12 20:10 ` Tejun Heo
2013-07-12 20:38 ` [PATCH v2 " Tejun Heo
[not found] ` <20130712203817.GI23680-9pTldWuhBndy/B6EtB590w@public.gmane.org>
2013-07-15 2:54 ` Li Zefan [this message]
[not found] ` <51E3645A.6080404-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2013-07-16 11:29 ` Tejun Heo
2013-07-16 11:29 ` 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=51E3645A.6080404@huawei.com \
--to=lizefan-hv44wf8li93qt0dzr+alfa@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.