diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index b4a6e797dea4..8414dc37a5c8 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -1957,6 +1957,10 @@ static ssize_t reclaim_write(struct file *file, const char __user *buf, if (type == RECLAIM_RANGE) { vma = find_vma(mm, start); while (vma) { + /* Moto lulei1: abort reclaim if app goes to foreground. */ + if (task->signal->oom_score_adj == 0) + break; + if (vma->vm_start > end) break; if (is_vm_hugetlb_page(vma)) @@ -1970,6 +1974,10 @@ static ssize_t reclaim_write(struct file *file, const char __user *buf, } } else { for (vma = mm->mmap; vma; vma = vma->vm_next) { + /* Moto lulei1: abort reclaim if app goes to foreground. */ + if (task->signal->oom_score_adj == 0) + break; + if (is_vm_hugetlb_page(vma)) continue;