On 10/14/2011 12:18 AM, David Miller wrote: > From: Glauber Costa > Date: Fri, 14 Oct 2011 00:14:40 +0400 > >> Are you happy, or at least willing to accept, an approach that keep >> things as they were with cgroups *compiled out*, or were you referring >> to not in use == compiled in, but with no users? > > To me these are the same exact thing, because %99 of users will be running > a kernel with every feature turned on in the Kconfig. Ok. Please let me know what do you think of the following patch. It is still crude, and applies on top of what I had, for simplicity. I can of course rework all the series for the next submission. The main idea is: We basically don't care about accounting if all tasks are in the same, root, cgroup. So I am using static_branch to enable this code path when the first !root cgroup is created - a stronger statement than just enabled/disabled by a runtime option. This should cover every single user that is not *actively* using cgroups (I understand that most distros will not only compile it in, but also leave it enabled...). When this code path is disabled, we should be doing the same as before. If you think this approach is valid, I am not left with the problem of how to replace the fields when cgroups are enabled. But for that I guess I can just copy the struct proto (probably only 2, or at most 3 protos will need it anyway), and make the new sockets run on this new structure. Cheers