mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-07 04:09:21 +00:00
lowmemorykiller: avoid false adaptive LMK triggers
In vmpressure notifier of LMK, shift_adj would have been set by a previous invocation of notifier, which is not followed by a lowmem_shrink yet. If this is follwed by a lower vmpressure, and then by a lowmem_shrink, ALMK still triggers because of the previous higher vmpressure notification. This is wrong. Since vmpressure has improved, reset shift_adj to avoid false adaptive LMK trigger. CRs-fixed: 893699 Change-Id: I2d77103d7c8f4d8a66e4652cba78e619a7bcef9a Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
This commit is contained in:
parent
2df937f43e
commit
deafbd6437
1 changed files with 9 additions and 0 deletions
|
@ -162,6 +162,15 @@ static int lmk_vmpressure_notifier(struct notifier_block *nb,
|
|||
trace_almk_vmpressure(pressure, other_free,
|
||||
other_file);
|
||||
}
|
||||
} else if (atomic_read(&shift_adj)) {
|
||||
/*
|
||||
* shift_adj would have been set by a previous invocation
|
||||
* of notifier, which is not followed by a lowmem_shrink yet.
|
||||
* Since vmpressure has improved, reset shift_adj to avoid
|
||||
* false adaptive LMK trigger.
|
||||
*/
|
||||
trace_almk_vmpressure(pressure, other_free, other_file);
|
||||
atomic_set(&shift_adj, 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue