lmkd: Do not treat RSS=0 as a sign of a process being dead
With kernel SPLIT_RSS_COUNTING feature it is possible for a valid process to report RSS of 0 size when reading /proc/pid/statm. This happens because split RSS accounting aggregates per-thread counters asynchronously and depending on the timing of the read, reported value can be inaccurate and occasionally be 0. lmkd currently treats processes reporting RSS of 0 as dead and removes them from the list of processes being tracked. This might lead to a valid process becoming unkillable. Change lmkd to stop treating RSS of 0 as a sign of a dead process. Bug: 160199622 Test: set ro.lmk.kill_heaviest_task=true and hack kernel to report RSS=0 Signed-off-by: Suren Baghdasaryan <surenb@google.com> Change-Id: Ia311d2f98649c92d1a487657f94ea51f57813b73
This commit is contained in:
parent
9f1be12b9a
commit
5263aa7800
2
lmkd.cpp
2
lmkd.cpp
|
|
@ -1898,7 +1898,7 @@ static struct proc *proc_get_heaviest(int oomadj) {
|
||||||
while (curr != head) {
|
while (curr != head) {
|
||||||
int pid = ((struct proc *)curr)->pid;
|
int pid = ((struct proc *)curr)->pid;
|
||||||
int tasksize = proc_get_size(pid);
|
int tasksize = proc_get_size(pid);
|
||||||
if (tasksize <= 0) {
|
if (tasksize < 0) {
|
||||||
struct adjslot_list *next = curr->next;
|
struct adjslot_list *next = curr->next;
|
||||||
pid_remove(pid);
|
pid_remove(pid);
|
||||||
curr = next;
|
curr = next;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue