Skip to content

Conversation

@htejun
Copy link
Contributor

@htejun htejun commented Nov 21, 2018

When a nested slice is being loaded for a service, the service may try to
propgate cgroup_subtree_mask upwards before the child slice is loaded setting
its cgroup_subtree_mask_valid prematurely. When the child slice calls
unit_update_cgroup_members_masks() after finishing loading, because it's
already marked valid, the function becomes a noop and the cgroup_subtree_mask
fails to propagate upwards. This could be easily triggered during user-@.slice
init.

Fix it by turning unit_update_cgroup_members_masks() noop for units in STUB
load state so that the first update is always after the unit is loaded.

When a nested slice is being loaded for a service, the service may try to
propgate cgroup_subtree_mask upwards before the child slice is loaded setting
its cgroup_subtree_mask_valid prematurely.  When the child slice calls
unit_update_cgroup_members_masks() after finishing loading, because it's
already marked valid, the function becomes a noop and the cgroup_subtree_mask
fails to propagate upwards.  This could be easily triggered during user-@.slice
init.

Fix it by turning unit_update_cgroup_members_masks() noop for units in STUB
load state so that the first update is always after the unit is loaded.
@htejun
Copy link
Contributor Author

htejun commented Nov 21, 2018

cc @cdown @davide125

@cdown
Copy link
Member

cdown commented Nov 21, 2018

Thanks a lot! This certainly explains some of the flakiness I saw during testing #10567.

Looks good to me from cgroup side.

@poettering
Copy link
Member

hmm, so #9512 gets rid of the subtree mask, and simplifies caching there a lot. It also reworks the logic so that units that didn't load properly will never cause controllers to be pulled in.

Hence, let's close this one, I am pretty sure it's made redundant by #9512.

@poettering poettering closed this Nov 23, 2018
facebook-github-bot pushed a commit to facebookarchive/rpm-backports that referenced this pull request Dec 11, 2018
Summary:
Rebase two fixes onto the version merged upstream:
systemd/systemd#10507
systemd/systemd#10567
and backport a few more:
systemd/systemd#10411
systemd/systemd#10493
systemd/systemd#10757
systemd/systemd#10876

These are almost all cgroup2 related.

Reviewed By: cdown

Differential Revision: D13351498

fbshipit-source-id: 87c8428d48dbb0eb2ae7d34f7381fff88f83872f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants