Proposed fix for cgroups mounting


#1

When supervisor is starting up it asks the following questions:

is /sys/fs/cgroup mounted with with a device name of "cgroupsRoot"
for each ["cpu,cpuacct", "memory", "freezer"] as subsys
    is /sys/fs/cgroup/<subsys> mounted with a device name of <subsys>

If any of those tests fail then Legato mounts the required cgroups itself.

All of this is fine, except that it is following an odd convention that can’t be depended on. Certainly on our AGL-derived build this is not quite the way those directories are mounted.

It doesn’t really matter what the device names are. What matters is the location and type of file system. Here is my mod to do just that.

is /sys/fs/cgroup mounted with with a fs type of "tmpfs"
for each ["cpu,cpuacct", "memory", "freezer"] as subsys
    is /sys/fs/cgroup/<subsys> mounted with a fs type of "cgroup"

I guess you could go the extra mile and test the options the fs was mounted with, and make sure “memory” was mounted as a cgroup with the option “memory”. But who would do something so intentionally confusing?

Here’s my changes:

CGroup fix commit


#2

I missed an instance of “tmpfs”, and I’ve updated my code on github. The new commit range is:


#3

If it makes it easier for Sierra, I can sync my fork up with legatoproject’s, then cherry-pick my commits to a convenient branch. I can even submit a pull request. Just tell me how you prefer it.


#4

Hi @cholmes ,

thanks for your contribution, and sorry we are not able to process it as efficiently as we would like.
I am working with some colleagues on a contribution process based on GitHub and an external Gerrit instance to distribute some proprietary content that SWI cannot distribute through GitHub.

We would ideally like to accept GitHub PR contributions but that might not be the case initially.

If you do not mind waiting for next week, we should have a workingish contribution process through that external Gerrit instance and it would be great for us if you could provide your changes through this process (as to debug things, and also to have your feedback about the whole experience).

Would that work for you?

Thanks


#5

I’m in no hurry. Count me in when you’re ready.


#6

Hi,
work is still on going,
keep you inform when it will be available.
best regards,