Skip to content

Conversation

@keszybz
Copy link
Member

@keszybz keszybz commented Mar 26, 2016

This is an alternative patch set for cgroup2 support sent by Tejun Heo to the mailing list.
I haven't yet compared it with #2271, but I'm putting it out as a pull request so we
can get the whole CI machinery going.

Don't merge yet.

htejun added 3 commits March 26, 2016 11:20
Unified hierarchy is official as of Linux v4.5 and now available through a new
filesystem type, cgroup2, with its own super magic.  Update mount logic
accordingly.
Earlier during the development of unified hierarchy, the populated event was
reported through by the dedicated "cgroup.populated" file; however, the
interface was updated so that it's reported through the "populated" field of
"cgroup.events" file.  Update populated event handling logic accordingly.
After receiving SIGCHLD, one of the ways manager_dispatch_sigchld() maps the
now zombie $PID to its unit is through manager_get_unit_by_pid_cgroup() which
reads /proc/$PID/cgroup and looks up the unit associated with the cgroup path.

On non-unified cgroup hierarchies, a process is immediately migrated to the
root cgroup on death and the cgroup lookup would always have returned the unit
associated with it, making it rather pointless but safe.  On unified hierarchy,
a zombie remains associated with the cgroup that it was associated with at the
time of death and thus manager_get_unit_by_pid_cgroup() will look up the unit
properly.

However, by the time manager_dispatch_sigchld() is running, the original cgroup
may have become empty and it and its associated unit might already have been
removed.  If the cgroup path doesn't yield a match, manager_dispatch_sigchld()
keeps pruning the leaf component.  This means that the function may return a
slice unit for a pid and as a slice doesn't have ->sigchld_event() handler,
calling invoke_sigchld_event() on it causes a segfault.

This patch updates invoke_sigchld_event() so that it skips calling if the
handler is not set.
@keszybz
Copy link
Member Author

keszybz commented Mar 26, 2016

The first commit is very similar to 7123187, but less complete. It seems we want 7123187 and the two other commits from this series on top.

@keszybz keszybz closed this Mar 26, 2016
@keszybz keszybz deleted the cgroup2-heo branch March 26, 2016 16:09
@keszybz keszybz mentioned this pull request Mar 26, 2016
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.

2 participants