libprocessgroup: Support memcg v1 per-app with PRODUCT_CGROUP_V2_SYS_APP_ISOLATION_ENABLED
We are enabling PRODUCT_CGROUP_V2_SYS_APP_ISOLATION_ENABLED by default
and also temporarily retaining support for overriding the new memcg v2
default back to v1. That means the default
PRODUCT_CGROUP_V2_SYS_APP_ISOLATION_ENABLED must work correctly with v1
per-application memcg paths, which is not currently the case. This
change uses knowledge about whether paths being generated are for a v1
cgroup or a v2 cgroup so that the common ConvertUid{Pid}ToPath functions
can continue to be used for both v1 and v2 cases.
Memcg v1 support will eventually be removed, so this change can be
reverted when that happens.
Test: boot cf_gwear_x86-trunk_staging-userdebug with
PRODUCT_CGROUP_V2_SYS_APP_ISOLATION_ENABLED = true.
cf_gwear_x86-trunk_staging-userdebug sets ro.config.low_ram
causing v1 per-app memcgs to be used.
Bug: 377579705
Change-Id: Iec26c02fd261bdec80a7e49fce4dc207d1996b1b
3 files changed