From: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Daniel Wagner <wagi-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Daniel Wagner
<daniel.wagner-98C5kh4wR6ohFhg+JK9F0w@public.gmane.org>,
Gao feng <gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>,
Jamal Hadi Salim <jhs-jkUAjuhPggJWk0Htik3J/w@public.gmane.org>,
John Fastabend
<john.r.fastabend-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>,
Neil Horman <nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
Subject: Re: [PATCH v3 4/8] cgroup: Remove CGROUP_BUILTIN_SUBSYS_COUNT
Date: Tue, 11 Sep 2012 13:41:55 -0700 [thread overview]
Message-ID: <20120911204155.GY7677@google.com> (raw)
In-Reply-To: <1347380774-9546-5-git-send-email-wagi-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
Hello, Daniel.
Just one nit.
On Tue, Sep 11, 2012 at 06:26:10PM +0200, Daniel Wagner wrote:
> @@ -4502,10 +4507,13 @@ int __init cgroup_init_early(void)
> for (i = 0; i < CSS_SET_TABLE_SIZE; i++)
> INIT_HLIST_HEAD(&css_set_table[i]);
>
> - /* at bootup time, we don't worry about modular subsystems */
> - for (i = 0; i < CGROUP_BUILTIN_SUBSYS_COUNT; i++) {
> + for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
> struct cgroup_subsys *ss = subsys[i];
>
> + /* at bootup time, we don't worry about modular subsystems */
> + if (!ss || (ss && ss->module))
> + continue;
> +
The middle "ss" test is unnecessary. Control never gets there if
NULL.
> @@ -4538,9 +4546,12 @@ int __init cgroup_init(void)
> if (err)
> return err;
>
> - /* at bootup time, we don't worry about modular subsystems */
> - for (i = 0; i < CGROUP_BUILTIN_SUBSYS_COUNT; i++) {
> + for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
> struct cgroup_subsys *ss = subsys[i];
> +
> + /* at bootup time, we don't worry about modular subsystems */
> + if (!ss || (ss && ss->module))
> + continue;
Ditto.
> @@ -4735,13 +4746,16 @@ void cgroup_fork_callbacks(struct task_struct *child)
> {
> if (need_forkexit_callback) {
> int i;
> - /*
> - * forkexit callbacks are only supported for builtin
> - * subsystems, and the builtin section of the subsys array is
> - * immutable, so we don't need to lock the subsys array here.
> - */
> - for (i = 0; i < CGROUP_BUILTIN_SUBSYS_COUNT; i++) {
> + for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
> struct cgroup_subsys *ss = subsys[i];
> +
> + /*
> + * forkexit callbacks are only supported for
> + * builtin subsystems.
> + */
> + if (!ss || (ss && ss->module))
> + continue;
> +
Ditto.
> @@ -4846,12 +4860,13 @@ void cgroup_exit(struct task_struct *tsk, int run_callbacks)
> tsk->cgroups = &init_css_set;
>
> if (run_callbacks && need_forkexit_callback) {
> - /*
> - * modular subsystems can't use callbacks, so no need to lock
> - * the subsys array
> - */
> - for (i = 0; i < CGROUP_BUILTIN_SUBSYS_COUNT; i++) {
> + for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
> struct cgroup_subsys *ss = subsys[i];
> +
> + /* modular subsystems can't use callbacks */
> + if (!ss || (ss && ss->module))
> + continue;
> +
Ditto.
> @@ -5037,13 +5052,17 @@ static int __init cgroup_disable(char *str)
> while ((token = strsep(&str, ",")) != NULL) {
> if (!*token)
> continue;
> - /*
> - * cgroup_disable, being at boot time, can't know about module
> - * subsystems, so we don't worry about them.
> - */
> - for (i = 0; i < CGROUP_BUILTIN_SUBSYS_COUNT; i++) {
> + for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
> struct cgroup_subsys *ss = subsys[i];
>
> + /*
> + * cgroup_disable, being at boot time, can't
> + * know about module subsystems, so we don't
> + * worry about them.
> + */
> + if (!ss || (ss && ss->module))
> + continue;
> +
Ditto.
Other than that,
Acked-by: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Thanks.
--
tejun
next prev parent reply other threads:[~2012-09-11 20:41 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-11 16:26 [PATCH v3 0/8] cgroup: Assign subsystem IDs during compile time Daniel Wagner
2012-09-11 16:26 ` [PATCH v3 1/8] cgroup: net_cls: Move sock_update_classid() declaration to cls_cgroup.h Daniel Wagner
2012-09-11 16:26 ` [PATCH v3 2/8] cgroup: net_cls: Do not define task_cls_classid() when not selected Daniel Wagner
2012-09-11 16:26 ` [PATCH v3 3/8] cgroup: net_prio: Do not define task_netpioidx() " Daniel Wagner
[not found] ` <1347380774-9546-4-git-send-email-wagi-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
2012-09-11 20:37 ` Tejun Heo
[not found] ` <1347380774-9546-1-git-send-email-wagi-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
2012-09-11 16:26 ` [PATCH v3 4/8] cgroup: Remove CGROUP_BUILTIN_SUBSYS_COUNT Daniel Wagner
[not found] ` <1347380774-9546-5-git-send-email-wagi-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
2012-09-11 20:41 ` Tejun Heo [this message]
2012-09-11 16:26 ` [PATCH v3 6/8] cgroup: Do not depend on a given order when populating the subsys array Daniel Wagner
2012-09-11 16:26 ` [PATCH v3 5/8] cgroup: Wrap subsystem selection macro Daniel Wagner
2012-09-11 16:26 ` [PATCH v3 7/8] cgroup: Assign subsystem IDs during compile time Daniel Wagner
2012-09-11 21:01 ` Tejun Heo
[not found] ` <20120911210109.GZ7677-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-09-11 21:08 ` Tejun Heo
2012-09-11 21:31 ` Daniel Wagner
[not found] ` <504FADC1.4060503-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
2012-09-11 21:36 ` Tejun Heo
[not found] ` <20120911213646.GF7677-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-09-11 21:39 ` Daniel Wagner
2012-09-11 21:15 ` Daniel Wagner
2012-09-11 21:27 ` Tejun Heo
[not found] ` <1347380774-9546-8-git-send-email-wagi-kQCPcA+X3s7YtjvyW6yDsg@public.gmane.org>
2012-09-11 21:04 ` Tejun Heo
[not found] ` <20120911210435.GA7677-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-09-11 21:15 ` Daniel Wagner
2012-09-11 16:26 ` [PATCH v3 8/8] cgroup: Define CGROUP_SUBSYS_COUNT according the configuration Daniel Wagner
2012-09-11 21:11 ` [PATCH v3 0/8] cgroup: Assign subsystem IDs during compile time Tejun Heo
[not found] ` <20120911211151.GC7677-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-09-11 21:19 ` Daniel Wagner
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=20120911204155.GY7677@google.com \
--to=tj-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=daniel.wagner-98C5kh4wR6ohFhg+JK9F0w@public.gmane.org \
--cc=gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org \
--cc=jhs-jkUAjuhPggJWk0Htik3J/w@public.gmane.org \
--cc=john.r.fastabend-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org \
--cc=wagi-kQCPcA+X3s7YtjvyW6yDsg@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.