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:
parent
c405900f87
commit
d5b510eb13
5
lmkd.c
5
lmkd.c
|
|
@ -748,7 +748,12 @@ static void mainloop(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc __unused, char **argv __unused) {
|
int main(int argc __unused, char **argv __unused) {
|
||||||
|
struct sched_param param = {
|
||||||
|
.sched_priority = 1,
|
||||||
|
};
|
||||||
|
|
||||||
mlockall(MCL_FUTURE);
|
mlockall(MCL_FUTURE);
|
||||||
|
sched_setscheduler(0, SCHED_FIFO, ¶m);
|
||||||
if (!init())
|
if (!init())
|
||||||
mainloop();
|
mainloop();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue