Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fcf04711 authored by Bart Van Assche's avatar Bart Van Assche
Browse files

init: Apply the NormalIoProfile when creating a service



Prepare for migration of the blkio controller to the v2 cgroup hierarchy
by applying the NormalIoProfile when starting a service. While the
NormalIoProfile is automatically applied when the blkio controller is
mounted in the v1 hierarchy, this is not the case for the v2 hierarchy.

Bug: 213617178
Change-Id: I3cad288a31aa2692e10c778ae1e5fdd04acd66d7
Signed-off-by: default avatarBart Van Assche <bvanassche@google.com>
parent 59387c97
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -653,6 +653,11 @@ Result<void> Service::Start() {
                       << ") failed for service '" << name_ << "'";
    }

    // When the blkio controller is mounted in the v1 hierarchy, NormalIoPriority is
    // the default (/dev/blkio). When the blkio controller is mounted in the v2 hierarchy, the
    // NormalIoPriority profile has to be applied explicitly.
    SetProcessProfiles(proc_attr_.uid, pid_, {"NormalIoPriority"});

    if (use_memcg) {
        ConfigureMemcg();
    }