No description
Find a file
T.J. Mercier 3b5bb3a364 libprocessgroup: Poll on cgroup.events
In killProcessGroup we currently read cgroup.procs to find processes to
kill, send them kill signals until cgroup.procs is empty, then remove
the cgroup directory. The cgroup cannot be removed until all processes
are dead, otherwise we'll get an EBUSY error from the kernel.

There is a race in the kernel where cgroup.procs can read empty even
though the cgroup is pinned by processes which are still exiting, and
can't be removed yet. [1]

Let's use the populated field of cgroup.events instead of an empty
cgroup.procs file to determine when the cgroup is removable. In
addition to functioning like we expect, this is more efficient because
we can poll on cgroup.events instead of retrying kills and rereading
cgroup.procs every 5ms which should help reduce CPU contention and
cgroup lock contention.

It's still possible that it takes longer for a cgroup to become
unpopulated than our timeout allows, in which case we will fail to
remove the cgroup and leak kernel memory. But this change should help
reduce the probability of that happening.

[1] https://lore.kernel.org/all/CABdmKX3SOXpcK85a7cx3iXrwUj=i1yXqEz9i9zNkx8mB=ZXQ8A@mail.gmail.com/

Bug: 301871933
Change-Id: If7dcfb331f47e06994c9ac85ed08bbcce18cdad7
2023-12-07 00:12:00 +00:00
bootstat bootstat: add more bootreasons 2023-10-20 05:56:34 +00:00
cli-test [LSC] Add LOCAL_LICENSE_KINDS to system/core 2021-02-19 12:59:05 -08:00
code_coverage Disable code_coverage.other for riscv64 2022-10-13 13:49:10 -07:00
debuggerd Avoid crashing on bad architecture value. 2023-11-17 22:12:14 +00:00
diagnose_usb Support building diagnose_usb against musl 2021-12-16 14:04:06 -08:00
fastboot Create integration test for fastboot CLI 2023-10-26 16:51:33 -07:00
fs_mgr fs_mgr_overlayfs: De-dup common methods 2023-11-27 11:16:41 +00:00
gatekeeperd Check AServiceManager_isDeclared before AServiceManager_getService 2023-06-14 02:43:54 +00:00
healthd Don't depend on String8 cast to C string 2023-09-20 15:11:54 +00:00
include Remove include/backtrace symlink. 2020-10-20 12:46:14 -07:00
init service_test: Test stopping services after migration to another cgroup 2023-11-27 14:27:02 -08:00
janitors Add myself to janitor owners. 2022-12-02 12:50:43 -08:00
libappfuse [LSC] Add LOCAL_LICENSE_KINDS to system/core 2021-02-19 12:59:05 -08:00
libasyncio Set min_sdk_version 2021-12-02 09:23:42 +09:00
libcrypto_utils Set min_sdk_version 2021-12-02 09:23:42 +09:00
libcutils Add an include 2023-10-06 18:46:17 +00:00
libgrallocusage Make apex_available explicit 2022-02-09 11:37:19 -08:00
libkeyutils Make libfs_mgr dependencies vendor_ramdisk_available. 2021-07-23 16:50:06 -07:00
libmodprobe Merge "libmodprobe: LPM: Cleanup of redundant check" 2023-06-29 17:21:18 +00:00
libnetutils add 'nodad' support to ifc_add_address() 2023-06-30 16:36:21 +00:00
libpackagelistparser Promote HWASan tests to presubmit. 2022-06-17 22:18:49 +00:00
libprocessgroup libprocessgroup: Poll on cgroup.events 2023-12-07 00:12:00 +00:00
libsparse Make simg2img host-only 2023-08-28 09:53:30 -07:00
libstats Add monicamwang and rayhdez to system/core/libstats/OWNERS 2023-10-11 17:52:25 -07:00
libsuspend libsuspend: vendor_available. 2021-11-02 13:52:40 -07:00
libsync Declare the headers of the ndk_library 2022-09-08 21:59:20 +00:00
libsystem Add COLOR_MODE_DISPLAY_BT2020 to graphics header. 2022-12-01 22:25:40 -08:00
libsysutils NetlinkEvent: trivial simplification. 2023-07-10 22:46:12 +00:00
libusbhost libusbhost: factor out frameworks descriptors -> byte[] code. 2022-01-24 13:35:20 -08:00
libutils Add StrongPointer::release() 2023-11-20 11:55:02 -05:00
libvndksupport libvndksupport: log sphal namespace fallback 2023-10-03 17:13:10 +00:00
llkd llkd: Disable in userdebug builds by default 2021-11-04 16:21:46 -07:00
mini_keyctl Merge "Make libmini_keyctl_static available in recovery" 2021-11-23 17:54:31 +00:00
mkbootfs mkbootfs: consistency. 2023-01-12 04:34:15 +00:00
property_service Initialize the appcompat system property folder 2023-10-19 20:17:55 +00:00
reboot [LSC] Add LOCAL_LICENSE_KINDS to system/core 2021-02-19 12:59:05 -08:00
rootdir Merge "Assigns system user/group to /dev/hidraw* devices." into main 2023-11-21 02:10:09 +00:00
run-as run-as: remove a special case. 2023-11-10 22:02:00 +00:00
sdcard [LSC] Add LOCAL_LICENSE_KINDS to system/core 2021-02-19 12:59:05 -08:00
shell_and_utilities Update shell_and_utilities docs for U. 2023-03-01 22:05:37 +00:00
storaged Added defaults for storaged fuzzers 2023-05-05 23:55:27 +00:00
toolbox Remove stray newline from err() call. 2023-09-07 19:30:31 +00:00
trusty Merge "Add tipc fuzzer for KeyMint/Rust" into main 2023-10-19 08:31:09 +00:00
usbd usb: migration to USB gadget AIDL 2023-01-10 11:24:36 +08:00
watchdogd [LSC] Add LOCAL_LICENSE_KINDS to system/core 2021-02-19 12:59:05 -08:00
.clang-format
.clang-format-2
.clang-format-4
.gitignore
CleanSpec.mk snapshotctl don't auto-merge. 2020-03-03 13:19:49 -08:00
METADATA Add METADATA to system/core: Apache2+BSD=NOTICE 2020-04-29 13:16:41 -07:00
MODULE_LICENSE_APACHE2
OWNERS Add bug component to system/core 2023-07-26 07:57:58 -07:00
PREUPLOAD.cfg Configure rustfmt for preupload hook 2022-04-06 21:11:09 +00:00
rustfmt.toml Configure rustfmt for preupload hook 2022-04-06 21:11:09 +00:00