mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-10-31 18:09:19 +00:00
mm: process_reclaim: fix reclaim skip on low efficiency
The logic used to skip reclaim on low efficiency results in process reclaim not triggering at all. Fix it by properly handling the skip_reclaim atomic variable. Change-Id: I119097bb9b1baf8f3e8d4afa0a6dc2c30c0de6e7 Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
This commit is contained in:
parent
d73bebc75f
commit
c27bb1e574
1 changed files with 2 additions and 2 deletions
|
@ -208,7 +208,7 @@ static void swap_fn(struct work_struct *work)
|
|||
|
||||
if (efficiency < swap_opt_eff) {
|
||||
if (++monitor_eff == swap_eff_win) {
|
||||
atomic_set(&skip_reclaim, swap_eff_win + 1);
|
||||
atomic_set(&skip_reclaim, swap_eff_win);
|
||||
monitor_eff = 0;
|
||||
}
|
||||
} else {
|
||||
|
@ -232,7 +232,7 @@ static int vmpressure_notifier(struct notifier_block *nb,
|
|||
if (!current_is_kswapd())
|
||||
return 0;
|
||||
|
||||
if (!atomic_dec_and_test(&skip_reclaim))
|
||||
if (0 <= atomic_dec_if_positive(&skip_reclaim))
|
||||
return 0;
|
||||
|
||||
if ((pressure >= pressure_min) && (pressure < pressure_max))
|
||||
|
|
Loading…
Reference in a new issue