From: Tejun Heo <tj@kernel.org>
To: Aleksa Sarai <cyphar@cyphar.com>
Cc: lizefan@huawei.com, mingo@redhat.com, peterz@infradead.org,
richard@nod.at, fweisbec@gmail.com, linux-kernel@vger.kernel.org,
cgroups@vger.kernel.org
Subject: Re: [PATCH v6 1/3] cgroups: use bitmask to filter for_each_subsys
Date: Mon, 16 Mar 2015 12:42:14 -0400 [thread overview]
Message-ID: <20150316164214.GB8353@htj.duckdns.org> (raw)
In-Reply-To: <1426307835-5893-2-git-send-email-cyphar@cyphar.com>
Hello,
On Sat, Mar 14, 2015 at 03:37:13PM +1100, Aleksa Sarai wrote:
> -/* This flag indicates whether tasks in the fork and exit paths should
> +/*
> + * This bitmask flag indicates whether tasks in the fork and exit paths should
Please reflow the comment. It's going over 80col. Also, wouldn't it
be clearer if the comment actually stated that the bitmask is
subsystem bitmask?
> @@ -4932,7 +4946,7 @@ static void __init cgroup_init_subsys(struct cgroup_subsys *ss, bool early)
> * init_css_set is in the subsystem's root cgroup. */
> init_css_set.subsys[ss->id] = css;
>
> - need_forkexit_callback |= ss->fork || ss->exit;
> + need_forkexit_callback |= !!(ss->fork || ss->exit) << ss->id;
I generally prefer (bool) casts to !!'s these days but this doesn't
really matter. More importantly, shouldn't we be splitting fork and
exit masks so that we don't have to test the callback existence later?
> @@ -5239,11 +5253,9 @@ void cgroup_post_fork(struct task_struct *child)
> * css_set; otherwise, @child might change state between ->fork()
> * and addition to css_set.
> */
> - if (need_forkexit_callback) {
> - for_each_subsys(ss, i)
> - if (ss->fork)
> - ss->fork(child);
> - }
> + for_each_subsys_which(need_forkexit_callback, ss, i)
> + if (ss->fork)
> + ss->fork(child);
> }
IOW, we should be able to do
for_each_subsys_which(subsys_has_fork, ss, i)
ss->fork(child);
And ditto for exit.
Thanks.
--
tejun
next prev parent reply other threads:[~2015-03-16 16:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-14 4:37 [PATCH v6 0/3] cgroups: add pids subsystem Aleksa Sarai
2015-03-14 4:37 ` [PATCH v6 1/3] cgroups: use bitmask to filter for_each_subsys Aleksa Sarai
2015-03-16 16:42 ` Tejun Heo [this message]
2015-03-14 4:37 ` [PATCH v6 2/3] cgroups: allow a cgroup subsystem to reject a fork Aleksa Sarai
[not found] ` <1426307835-5893-3-git-send-email-cyphar-gVpy/LI/lHzQT0dZR+AlfA@public.gmane.org>
2015-03-16 16:53 ` Tejun Heo
[not found] ` <20150316165335.GC8353-piEFEHQLUPpN0TnZuCh8vA@public.gmane.org>
2015-03-21 11:25 ` Aleksa Sarai
[not found] ` <CAOviyagGvm4z8eAWitR267U3br-60vVJ9A5MMtFENy9xt9zuLQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-26 15:08 ` Tejun Heo
2015-03-26 14:38 ` Aleksa Sarai
[not found] ` <CAOviyahTq1K6zBRfmXfepabiQ7xU8ZoNdq0jPd3nP4Q-0H1DDQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-26 15:02 ` Tejun Heo
2015-03-26 21:41 ` Aleksa Sarai
[not found] ` <CAOviyah+5DFxYtUo1=LMdQLAte=YR1s4JYoH_DNZEfpoBUfSRw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-26 22:18 ` Tejun Heo
2015-03-14 4:37 ` [PATCH v6 3/3] cgroups: add a pids subsystem Aleksa Sarai
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=20150316164214.GB8353@htj.duckdns.org \
--to=tj@kernel.org \
--cc=cgroups@vger.kernel.org \
--cc=cyphar@cyphar.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=richard@nod.at \
/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