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
This commit is contained in:
Colin Cross 2014-07-14 14:31:15 -07:00
parent b28ff91313
commit 1a0d9be53e

View file

@ -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();