Commit graph

424 commits

Author SHA1 Message Date
T.J. Mercier
8972ce18d2 libprocessgroup: Remove ramdisk_available from libcgrouprc
...which no longer appears to be required.

Bug: 349105928
Change-Id: I0586f76147d9519ef6a520a10164e1b0f5e5c9b8
2024-12-02 17:41:12 +00:00
T.J. Mercier
62f8723f67 libprocessgroup: Remove vendor_ramdisk_available from libcgrouprc
...which no longer appears to be required.

Bug: 349105928
Change-Id: I9fc71f9cf3238dcc935da63ce1a3b0b69d9cccc1
2024-12-02 17:41:12 +00:00
T.J. Mercier
f26b13aeb1 libprocessgroup: Remove recovery_available from libcgrouprc
...which no longer appears to be required.

Bug: 349105928
Change-Id: I0ad1f44912fdaf98c05b60402c0166c535155775
2024-12-02 17:41:12 +00:00
T.J. Mercier
b053403046 Merge "Reapply "libprocessgroup: Remove __BEGIN_DECLS and __END_DECLS"" into main 2024-11-21 22:14:07 +00:00
Maciej Żenczykowski
3e7c17a8e7 Reapply "libprocessgroup: Remove __BEGIN_DECLS and __END_DECLS"
This reverts commit fdaaef9523.

Reason for revert: should be safe to reapply post
  https://android-review.git.corp.google.com/c/platform/packages/modules/Connectivity/+/3369257

Test: TreeHugger
Bug: 379796721
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I1a24791713484461345312a34777c2266e443cee
2024-11-20 19:37:38 +00:00
Maciej Żenczykowski
5c14720b5a Merge "Revert "libprocessgroup: Remove __BEGIN_DECLS and __END_DECLS"" into main 2024-11-19 20:43:39 +00:00
Maciej Żenczykowski
fdaaef9523 Revert "libprocessgroup: Remove __BEGIN_DECLS and __END_DECLS"
This reverts commit fdf4432356.

Reason for revert: b/379796721

Change-Id: I34cdc69d5b8d11446da02106b7bd593a8c8151c3
2024-11-19 19:24:54 +00:00
Treehugger Robot
569db94fa8 Merge changes Iae1cbfcc,I4466838c,I19c75e50,I2f49fab1 into main
* changes:
  libprocessgroup: Remove __BEGIN_DECLS and __END_DECLS
  libprocessgroup: Convert CGROUPV2_HIERARCHY_NAME to std::string
  libprocessgroup: Remove CGROUPV2_CONTROLLER_NAME
  libprocessgroup: Remove CGROUPS_RC_PATH
2024-11-18 19:57:51 +00:00
T.J. Mercier
fdf4432356 libprocessgroup: Remove __BEGIN_DECLS and __END_DECLS
These macros have been useless in this file since commit 82b72a566
("libprocessgroup: Add support for task profiles") in 2018 which added
C++ includes, and C++ types and keywords inside an extern "C" block.

Change-Id: Iae1cbfcc5cb974034d88fb466b79088496190940
2024-11-14 23:04:10 +00:00
T.J. Mercier
b6071f19c3 libprocessgroup: Convert CGROUPV2_HIERARCHY_NAME to std::string
Almost everywhere CGROUPV2_HIERARCHY_NAME is used a std::string is
required, so change its type to avoid temporaries.

Change-Id: I4466838c510f2eb8212fc71999cdaa47359ce9c3
2024-11-14 22:56:11 +00:00
T.J. Mercier
9e5f74d4e4 libprocessgroup: Remove CGROUPV2_CONTROLLER_NAME
This was deprecated a year ago, and should no longer be used.

Change-Id: I19c75e50fd3cc86734fa9cc7f3d883260b2484ca
2024-11-14 22:44:33 +00:00
T.J. Mercier
148c2531ee libprocessgroup: Remove CGROUPS_RC_PATH
/dev/cgroup_info/cgroup.rc doesn't exist anymore!

Bug: 349105928
Change-Id: I2f49fab15d083f0c1617989ccf96ca843f998140
2024-11-14 22:44:33 +00:00
Treehugger Robot
de8fa774c3 Merge "libprocessgroup: Remove libcgrouprc_format" into main 2024-11-14 18:23:42 +00:00
Siarhei Vishniakou
9ad453ffae Set input thread priority to RT - try 4
This reverts commit 52da71d47b.

Reason for revert: camera was using its own stale copy of libprocessgroup, and now has revved up its version that includes the new parsing code. So this time the json file update should work OK.

Original description:

To improve input latency, set the critical input threads to RT priority.
This will use RT priority on AOSP devices by default. OEMs can still
choose to customize what "input policy" means for their device, which
may not necessarily mean RT.

For example, on device with multiple small / big cores, input task
affinity could be changed to prioritize big cores + higher CPU frequency
/ voltage, but still keep the standard / default input thread priority.

Note: there is an open issue where the thread priority is not remaining constant. See b/378761104.

Bug: 330719044
Bug: 378761104
Flag: com.android.input.flags.enable_input_policy_profile
Test: took perfetto trace and checked the priority on InputDispatcher
and InputReader threads.

Change-Id: I449be0eeeac989222f5deefa62615478bd65b968
2024-11-13 00:56:06 +00:00
T.J. Mercier
64148e33d1 libprocessgroup: Remove libcgrouprc_format
This is no longer depended on anywhere.

Bug: 349105928
Change-Id: I7aba0a0d4e8a851edfc5e43daa1d9b5553adcdc3
2024-11-12 23:57:50 +00:00
Liana Kazanova
52da71d47b Revert "Set input thread priority to RT - try 3"
This reverts commit a2bd0e6b5d.

Reason for revert:DroidMonitor: Potential culprit for http://b/377739155 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: I4c2b686aaf291db819d37711d4427d0094ca2295
2024-11-06 21:42:29 +00:00
Siarhei Vishniakou
a2bd0e6b5d Set input thread priority to RT - try 3
This partially reverts commit de6707df0c.

Reason for revert: code change landed, now modifying JSON file only

Original description:

To improve input latency, set the critical input threads to RT priority.
This will use RT priority on AOSP devices by default. OEMs can still
choose to customize what "input policy" means for their device, which
may not necessarily mean RT.

For example, on device with multiple small / big cores, input task
affinity could be changed to prioritize big cores + higher CPU frequency
/ voltage, but still keep the standard / default input thread priority.

With this patch, I'm finding that sometimes, one of the critical input
threads has priority 100 instead of the expected 98. Still looking into
that specific issue, but the issue is already present with the existing
"input policy" code.

Bug: 330719044
Flag: com.android.input.flags.enable_input_policy_profile
Test: took perfetto trace and checked the priority on InputDispatcher
and InputReader threads.

Change-Id: I7d8a941f36ad9e4b75a7a0f4c5d81895256d6919
2024-11-06 16:57:37 +00:00
T.J. Mercier
8a45aaaf12 libprocessgroup: Update libprocessgroup dependencies
Bug: 349105928
Change-Id: Iee047ccafe4c71eaf9c614fbe9a68585645a16f8
2024-11-01 21:16:29 +00:00
Treehugger Robot
7ba45dca19 Merge "Set input thread priority to RT - try 2" into main 2024-10-31 23:51:47 +00:00
Siarhei Vishniakou
a3cf826de6 Set input thread priority to RT - try 2
This reverts commit de6707df0c.

Reason for revert: changing code without modifying JSON file now

Original description:

To improve input latency, set the critical input threads to RT priority.
This will use RT priority on AOSP devices by default. OEMs can still
choose to customize what "input policy" means for their device, which
may not necessarily mean RT.

For example, on device with multiple small / big cores, input task
affinity could be changed to prioritize big cores + higher CPU frequency
/ voltage, but still keep the standard / default input thread priority.

With this patch, I'm finding that sometimes, one of the critical input
threads has priority 100 instead of the expected 98. Still looking into
that specific issue, but the issue is already present with the existing
"input policy" code.

Bug: 330719044
Flag: com.android.input.flags.enable_input_policy_profile
Test: took perfetto trace and checked the priority on InputDispatcher
and InputReader threads.

Change-Id: I3dabf4da0398324cf542e701c103551343b883cf
2024-10-31 22:39:25 +00:00
Maciej Żenczykowski
503ac71b43 Merge "Revert "Set input thread priority to RT"" into main 2024-10-31 21:31:23 +00:00
Liana Kazanova
de6707df0c Revert "Set input thread priority to RT"
This reverts commit 930f77b02c.

Reason for revert: DroidMonitor: Potential culprit for http://b/376665573 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: I9b9914703946f1eb4e40e779aa9cb5154ea108d3
2024-10-31 18:43:18 +00:00
Treehugger Robot
ce6982c76b Merge "Set input thread priority to RT" into main 2024-10-31 00:17:00 +00:00
Siarhei Vishniakou
930f77b02c Set input thread priority to RT
To improve input latency, set the critical input threads to RT priority.
This will use RT priority on AOSP devices by default. OEMs can still
choose to customize what "input policy" means for their device, which
may not necessarily mean RT.

For example, on device with multiple small / big cores, input task
affinity could be changed to prioritize big cores + higher CPU frequency
/ voltage, but still keep the standard / default input thread priority.

With this patch, I'm finding that sometimes, one of the critical input
threads has priority 100 instead of the expected 98. Still looking into
that specific issue, but the issue is already present with the existing
"input policy" code.

Bug: 330719044
Flag: com.android.input.flags.enable_input_policy_profile
Test: took perfetto trace and checked the priority on InputDispatcher
and InputReader threads.

Change-Id: I75b6a726f0d066f16bdec26f6cf90721479d17ff
2024-10-30 00:09:32 +00:00
T.J. Mercier
96fc434b6c libprocessgroup: Remove ifdefery around SetTimerSlackAction::ExecuteForTask
This appears to have been due to the use of prctl, which apparently
caused issues for mac builds. Now that use of prctl has been removed, it
doesn't look like we need this anymore.

Fixes: 075008174 ("libprocessgroup: Remove prctl interface for setting timer slack")
Test: m
Bug: 372498744
Change-Id: I8a43951f30d7dd838591a8ba225d712742d7cd4a
2024-10-26 00:34:51 +00:00
T.J. Mercier
9611c18aa2 Don't use android::base::StartsWith / EndsWith
These libbase functions now directly pass through to the standard
library. [1] Use the standard library directly, and eliminate this
dependency on libbase.

[1] https://r.android.com/c/platform/system/libbase/+/3315082

Change-Id: I83d79ffa2658f30ae09a7f27cedf14e62b5df41d
2024-10-25 17:20:01 +00:00
T.J. Mercier
490b505a3f Merge changes from topic "reapply_no_cgroup.rc" into main
* changes:
  Reapply "libprocessgroup: Combine all 3 ActivateControllers imple..."
  Reapply "libprocessgroup: Remove ACgroupController_getMaxActivati..."
  Reapply "libprocessgroup: Remove dependency on libcgrouprc"
  Reapply "libprocessgroup: Remove cgroup.rc file"
2024-10-22 15:07:17 +00:00
Yihan Dong
f255ce1786 Merge "Add proposed trendy teams for VTS modules" into main 2024-10-22 00:09:17 +00:00
T.J. Mercier
cbe09a8058 Remove carlosgalo from libprocessgroup OWNERS
Change-Id: I37cac7694491a7efe16e835776dcd8be7335eabe
2024-10-21 17:10:34 +00:00
Treehugger Robot
2307e47ed0 Merge "libprocessgroup: Remove SetClamps action" into main 2024-10-15 22:56:36 +00:00
T.J. Mercier
3984611601 libprocessgroup: Add SetSchedulerPolicy Action
Add a new profile action that allows users to set a scheduler policy and
priority for a thread when a profile with the action is applied. This
can be used with the POSIX policies specified in the sched_setscheduler
man page. A priority value is required for real-time policies. A nice
value may optionally be provided for normal policies.

If a normal policy is used and a nice value is provided, it will be
applied with setpriority() after the scheduler policy is applied. The
range of nice values that can be used in the task profiles JSON in this
case is [-20, 19].

If a real-time policy is used, the range of priorities that can be used
in the task profiles JSON is [1, 99] which will be mapped onto
[sched_get_priority_min(), sched_get_priority_max()] at runtime for the
the provided policy.

Here are some examples:

Use lowest-priority with FIFO policy:
"Actions": [
  {
    "Name": "SetSchedulerPolicy",
    "Params":
    {
      "Policy": "SCHED_FIFO",
      "Priority": 1
    }
  }
]

Use highest-priority (lowest nice) with standard NORMAL scheduler:
"Actions": [
  {
    "Name": "SetSchedulerPolicy",
    "Params":
    {
      "Policy": "SCHED_OTHER",
      "Nice": -20
    }
  }
]

Bug: 368072932
BYPASS_INCLUSIVE_LANGUAGE_REASON=false positive
Change-Id: I502ceb3913016e9f4e6b6322cc0eee905c9a5c9a
2024-10-14 21:00:11 +00:00
Yihan Dong
900ef7bf3a Add proposed trendy teams for VTS modules
Change-Id: I4f62c5105f51b37fe61efe3ea61a88036cfb4b96
Test: build locally
Bug: 368362374
2024-10-12 08:53:10 +00:00
T.J. Mercier
2a030efe67 libprocessgroup: Remove SetClamps action
The SetClamps profile action has always been a no-op. Remove the class
and parsing code for this action.

Bug: 372915523
Change-Id: Ic6e685aa992b83464dfb5e6446b622a57ed61db5
2024-10-11 17:08:40 +00:00
T.J. Mercier
3e4b58e9d4 libprocessgroup: Remove unused prctl include
Fixes: 075008174 ("libprocessgroup: Remove prctl interface for setting timer slack")
Test: m
Bug: 372498744
Change-Id: Icb65d631cdc52b5f5434b33a593adf706314f66e
2024-10-10 16:25:46 +00:00
Treehugger Robot
3aff5e6b0a Merge "libprocessgroup: Use pid_t for ProfileAction::ExecuteForTask" into main 2024-10-10 00:13:25 +00:00
T.J. Mercier
b53eb9dbc6 libprocessgroup: Use pid_t for ProfileAction::ExecuteForTask
This was missed in commit 1c007996b ("libprocessgroup: Use pid_t
consistently for TIDs").

Change-Id: Idefc9e7c2161ab3163bd1a0cb68b899e10e9c8ed
2024-10-09 22:47:40 +00:00
T.J. Mercier
0750081742 libprocessgroup: Remove prctl interface for setting timer slack
Support for the procfs timerslack interface has existed since linux 4.6.
All currently supported Android kernels are newer than 4.6, so remove
the userspace support for the prctl interface leaving just the use of
/proc/<tid>/timerslack_ns.

Bug: 372498744
Change-Id: Ib34cc6fbb4bab328cde51d60ac4e3b26a0d72851
2024-10-09 18:43:56 +00:00
T.J. Mercier
787ddbc8a5 Reapply "libprocessgroup: Combine all 3 ActivateControllers imple..."
This reverts commit 0fa49253a4.

Change-Id: I83121ff295caaabc0a2fd8a606ee2d52dacb0174
2024-10-08 23:42:55 +00:00
T.J. Mercier
47580ff76d Reapply "libprocessgroup: Remove ACgroupController_getMaxActivati..."
This reverts commit aeca8793f5.

Change-Id: I06e7e651f0cabfd43b50a278baf36f31f6061a8f
2024-10-08 23:42:54 +00:00
T.J. Mercier
c76b6ada23 Reapply "libprocessgroup: Remove dependency on libcgrouprc"
This reverts commit 691ad736bb.

Change-Id: I6615792c24b5c3151ba789248cfbdfefaf57a1e4
2024-10-08 23:42:52 +00:00
T.J. Mercier
a09ee8ece6 Reapply "libprocessgroup: Remove cgroup.rc file"
This reverts commit 972a2d30f8.

Change-Id: Icdf2824675e515ea3656b1c58ac55160ecc337df
2024-10-08 23:42:49 +00:00
Priyanka Advani (xWF)
972a2d30f8 Revert "libprocessgroup: Remove cgroup.rc file"
Revert submission 3212512

Reason for revert: Droidmonitor created revert due to b/372273614. Will be verifying through ABTD before submission.

Reverted changes: /q/submissionid:3212512

Change-Id: I37568516e973cb940f1229d52f94b8dc801da2ab
2024-10-08 18:54:37 +00:00
Priyanka Advani (xWF)
691ad736bb Revert "libprocessgroup: Remove dependency on libcgrouprc"
Revert submission 3212512

Reason for revert: Droidmonitor created revert due to b/372273614. Will be verifying through ABTD before submission.

Reverted changes: /q/submissionid:3212512

Change-Id: I15c7763467cd9f65d4b389b2d4ccaff92012f21f
2024-10-08 18:54:37 +00:00
Priyanka Advani (xWF)
aeca8793f5 Revert "libprocessgroup: Remove ACgroupController_getMaxActivati..."
Revert submission 3212512

Reason for revert: Droidmonitor created revert due to b/372273614. Will be verifying through ABTD before submission.

Reverted changes: /q/submissionid:3212512

Change-Id: I0964d1300791334cdc9e98220324d934f7ba113e
2024-10-08 18:54:37 +00:00
Priyanka Advani (xWF)
0fa49253a4 Revert "libprocessgroup: Combine all 3 ActivateControllers imple..."
Revert submission 3212512

Reason for revert: Droidmonitor created revert due to b/372273614. Will be verifying through ABTD before submission.

Reverted changes: /q/submissionid:3212512

Change-Id: I3dadc0b7bccfe28bb067a93df2acf2c3ea0f9920
2024-10-08 18:54:40 +00:00
T.J. Mercier
5161033f66 libprocessgroup: Combine all 3 ActivateControllers implementations into one
Remove this code duplication and use just one interface.

Bug: 349105928
Change-Id: Id8c7186d9665e9087a654f5781b7593b06349160
2024-10-03 17:01:34 +00:00
T.J. Mercier
c31c5a75c8 libprocessgroup: Remove ACgroupController_getMaxActivationDepth
This was targeted for API 36 which doesn't exist yet, so this was never
released. Now that libprocessgroup does not use the libcgrouprc
interfaces, this can be removed.

Bug: 349105928
Bug: 359609093
Change-Id: I2ea466c9e8bc54bf9178fa74b45e88f26d3e4c69
2024-10-03 17:01:34 +00:00
T.J. Mercier
9d84103bdd libprocessgroup: Remove dependency on libcgrouprc
Read cgroup descriptors ourselves instead of going through the LLNDK
interface which performs the same thing.

Bug: 349105928
Change-Id: I94625ffd0d884d619eb3449e63a305ad5e1d77e3
2024-10-03 17:01:34 +00:00
T.J. Mercier
ae4ce8ccc5 libprocessgroup: Remove cgroup.rc file
The cgroup.rc file was introduced in 192aee782 ("libprocessgroup: Add
support for task profiles") back with the initial support for task
profiles. It was intended to optimize performance associated with cgroup
operations. However over time, supporting this file led to making
libprocessgroup code more complicated (such as the cgrouprc LLNDK
interface), and the file ended up getting mmaped into nearly every
process on Android even though only a handful of them actually use it.
Replacing this file with reading and parsing of cgroup information on
demand allows us to simplify and shrink libprocessgroup, and eliminates
thousands of unused mappings without negatively affecting boot time or
other performance metrics.

Bug: 349105928
Test: Verified with memcg v2 and MaxActivationDepth 1 on Cuttlefish, Raven, and Mokey
Change-Id: Ic3f01fdf7fda89a56ab80657e1cf4573156273e6
2024-10-03 17:01:34 +00:00
T.J. Mercier
981664df08 libprocessgroup: Remove schedtune support
Schedtune was an out of tree cgroup controller present in Android
kernels up to 4.19. It was replaced with uclamp and the cpu controller.
Now that 4.19 is EOL and unsupported, and schedtune is not present in
any supported Android kernels, remove the userspace support for
schedtune.

Bug: 362504801
Change-Id: If8baaf1a616984c5dbaac1bbd03e23ad001bc29c
2024-10-02 14:47:45 +00:00