-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Recently we added kernelkill support to kill using cgroup2 cgroup.kill control file. Turns out it often marks kill as failed because it does not account nrKilled correctly. This makes post action delay no longer work, and thus we may kill sibling cgroups that's not misbehaving. The root cause of such behavior is that writing to cgroup.kill does not immediately reduce the number in pids.current. The previous kill logics walks through cgroup.procs in all nested cgroups and send sigkill one by one. That could fail in may cases e.g. process gone by the time you send signal. Therefore it needs to keep track of nrKilled and have a loop with multiple trials. However, with cgroup.kill, we can simply assume writing to it should get all processes kill eventually. If not, oomd will handle it after post action delay. This diff: - Make freezing cgroup optional. If freeze fails, we should still kill - No longer unfreeze cgroup at the end. The cgroup is supposed to be gone after killed - Remove the while loop because writing to cgroup.kill should ensure all processes are eventually killed - Only read pids.current once and assume that will be the nrKilled if writing to cgroup.kill succeeds, and don't kill if the file cannot be read or reads zero - Log if nrKilled is zero Differential Revision: D64848249 fbshipit-source-id: af2a70d80aeba5ce7aaaac376128255ad7248bcb
- Loading branch information
1 parent
a621170
commit e9e97ae
Showing
3 changed files
with
22 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters