LKML Archive on
help / color / mirror / Atom feed
From: Aleksa Sarai <>
To: Tejun Heo <>
Cc:,,,, "Frédéric Weisbecker" <>,,
Subject: Re: [PATCH v8 3/4] cgroups: allow a cgroup subsystem to reject a fork
Date: Tue, 7 Apr 2015 23:47:02 +1000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Hi Tejun,

>> I tried doing this and the kernel would refuse to boot. I believe it has
>> something to do with the ordering of early_init subsystems, but I'm not
> Hmmm... yeah, failure in early_init can be tricky to debug.

Okay, I took another look and it isn't that there are hard ordering
dependencies, it's because of how I wrote the tagging macro for cgroup_subsys.h
that caused a NULL deref during the early_init. Whoops.

>> entirely sure (this optimisation can be dealt with later [it's non-critical],
>> so IMO this should be done in a separate patchset [if at all]). Also, your
>> later comments would fix the subsys bitmask problem (we can just pass the
>> default %NULL), we don't even need to test the index.
> [...] I don't
> think it's a good idea to send the patches as-are because we can't
> debug and fix them properly, right? [...]

In what way are they hard to debug?

> [...] If there are hard ordering
> dependencies, the range of subsystems which require fork/exit doesn't
> have to be at the beginning.

I just spent a few hours trying to write it and it's just too dodgy to live.
Either you have a solution that won't work with nested tags, and is generally
just kind of bad or you have a solution that requires you to keep two separate
enumerations in sync. And of course you need to offset the index you're looking
stuff up in ss_state so that also looks bad.

But that's all besides the point because, *even if* it I had a clean solution,
it still wouldn't solve the fact that we are
> [...] adding quite a few loops in relatively hot paths.
You kind of _need_ to loop over all the subsystems in either case, the only
difference between having an array of CGROUP_SUBSYS_COUNT pointers or
CGROUP_PREFORK_COUNT is the few bytes of memory you've "saved" (at the expense
of making the callback code essentially unreadable).

Aleksa Sarai (cyphar)

  reply	other threads:[~2015-04-07 13:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-01  8:57 [PATCH v8 0/4] cgroups: add pids subsystem Aleksa Sarai
2015-04-01  8:57 ` [PATCH v8 1/4] cgroups: use bitmask to filter for_each_subsys Aleksa Sarai
2015-04-01  8:57 ` [PATCH v8 2/4] cgroups: replace explicit ss_mask checking with for_each_subsys_which Aleksa Sarai
2015-04-01  8:57 ` [PATCH v8 3/4] cgroups: allow a cgroup subsystem to reject a fork Aleksa Sarai
2015-04-01 16:02   ` Tejun Heo
2015-04-02 23:42     ` Aleksa Sarai
2015-04-06 15:05       ` Tejun Heo
2015-04-07 13:47         ` Aleksa Sarai [this message]
2015-04-07 14:00           ` Tejun Heo
2015-04-01  8:57 ` [PATCH v8 4/4] cgroups: implement the 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH v8 3/4] cgroups: allow a cgroup subsystem to reject a fork' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).