Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752866AbbDGNrF (ORCPT ); Tue, 7 Apr 2015 09:47:05 -0400 Received: from mail-ig0-f180.google.com ([209.85.213.180]:37783 "EHLO mail-ig0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753573AbbDGNrC (ORCPT ); Tue, 7 Apr 2015 09:47:02 -0400 MIME-Version: 1.0 X-Originating-IP: [122.106.150.15] In-Reply-To: <20150406150536.GA10582@htj.duckdns.org> References: <1427878641-5273-1-git-send-email-cyphar@cyphar.com> <1427878641-5273-4-git-send-email-cyphar@cyphar.com> <20150401160258.GP9974@htj.duckdns.org> <20150406150536.GA10582@htj.duckdns.org> Date: Tue, 7 Apr 2015 23:47:02 +1000 Message-ID: Subject: Re: [PATCH v8 3/4] cgroups: allow a cgroup subsystem to reject a fork From: Aleksa Sarai To: Tejun Heo Cc: lizefan@huawei.com, mingo@redhat.com, peterz@infradead.org, richard@nod.at, =?UTF-8?B?RnLDqWTDqXJpYyBXZWlzYmVja2Vy?= , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2139 Lines: 48 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) www.cyphar.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/