Commit graph

6 commits

Author SHA1 Message Date
Treehugger Robot
aec29a4d97 Merge "libprocessgroup: fix task_profile_test to correctly detect cgroup v2" am: 253f33aac5 am: 32aaf75a1a am: 3395088268
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2534619

Change-Id: I1583db34987048d4d2680e50b738aee7d8c8cd8e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-12 23:19:02 +00:00
Suren Baghdasaryan
d09713fe40 libprocessgroup: fix task_profile_test to correctly detect cgroup v2
Use correct attribute of the mntent to check for cgroup v2 entry.

Bug: 277233783
Change-Id: Ie34b89b610117b8ce043f2f18947273d75618fef
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2023-04-12 21:07:50 +00:00
T.J. Mercier
673da5b972 Revert "Revert "libprocessgroup: Add support for SetUserProfiles""
This reverts commit aee11b0a3d.

This change was originally reverted because its only user was reverted
under b/243096961 at ag/19679188. We bring it back now with a fixed user.

Bug: 236708592
Bug: 148425913
Ignore-AOSP-First: Topic with AMS changes which is developed on git_master

Change-Id: I2a8ae0d9faabe7950b758a09870d128889be4d0a
2022-09-27 17:42:19 +00:00
Dan Shi
aee11b0a3d Revert "libprocessgroup: Add support for SetUserProfiles"
Revert "Freeze package cgroup before killing"

Revert submission 19436294-freeze_kill

Reason for revert: b/243096961
Reverted Changes:
I06aaa5a08:Freeze package cgroup before killing
I45e34244f:libprocessgroup: Add support for SetUserProfiles

Bug: 243096961
Change-Id: I32162341d6a38f458a9c59d63e0cdc56a97f1efe
2022-08-19 18:40:14 +00:00
T.J. Mercier
e6281db539 libprocessgroup: Add support for SetUserProfiles
Provide SetUserProfiles API to apply profiles at UID level.

This enables applying the freezer profile to an entire UID instead of
just individual process cgroups.

Test: bash arg: -p
Test: bash arg: com.haok.nirvana
Test: bash arg: 1
Test: args: [-p, com.haok.nirvana, 1]
Test: arg: "-p"
Test: arg: "com.haok.nirvana"
Test: arg: "1"
Test: data="com.haok.nirvana"
Test: Events injected: 1
Test: ## Network stats: elapsed time=14ms (0ms mobile, 0ms wifi, 14ms not connected)
Test: raven:/ $ ps -eo pid,uid,ppid,name|grep 10266
Test: 2499 10266   823 com.haok.nirvana
Test: 2577 10266   823 com.haok.nirvana:resident
Test: 2584 10266   823 android.media
Test: 2669 10266     1 app_d
Test: 2672 10266     1 app_d
Test: raven:/ $ am force-stop com.haok.nirvana
Test: raven:/ $ ps -eo pid,uid,ppid,name|grep 10266
Test: 1|raven:/ $
Ignore-AOSP-First: Topic with AMS changes which is developed on git_master
Bug: 236708592
Change-Id: I45e34244f9943c217757cf346c9410672a1ce365
2022-08-02 18:23:41 +00:00
Bart Van Assche
59af680023 Add support for optional cgroup attributes
Cgroup attributes like io.weight or io.bfq.weight only exist if the
corresponding I/O scheduler has been loaded. Hence add support for
ignoring failures to write to a cgroup attribute that does not exist.

Bug: 213617178
Test: This patch has been tested in combination with patch "Migrate the blkio controller to the cgroup v2 hierarchy".
Change-Id: I5debafabc4dd430a1b98ea343bf3740c764edcc3
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-03-16 19:55:46 +00:00