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

Commit 1a0d9be5 authored by Colin Cross's avatar Colin Cross
Browse files

lmkd: make lmkd SCHED_FIFO

If kswapd runs more than lmkd it may throw away all page cache pages
before lmkd gets a chance to kill a process.  Make lmkd SCHED_FIFO
so it can react quickly to kernel low memory notifications.

Bug: 16236289
Change-Id: I46767b4ec81ef8638d0c9e47d168a68b62e3cac5
parent b28ff913
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -748,7 +748,12 @@ static void mainloop(void) {
}

int main(int argc __unused, char **argv __unused) {
    struct sched_param param = {
            .sched_priority = 1,
    };

    mlockall(MCL_FUTURE);
    sched_setscheduler(0, SCHED_FIFO, &param);
    if (!init())
        mainloop();