mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-07 04:09:21 +00:00
[PATCH] oom: swapoff tasks tweak
PF_SWAPOFF processes currently cause select_bad_process to return straight away. Instead, give them high priority, so we will kill them first, however we also first ensure no parallel OOM kills are happening at the same time. Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
4a3ede107e
commit
af5b912435
1 changed files with 6 additions and 2 deletions
|
@ -59,6 +59,12 @@ unsigned long badness(struct task_struct *p, unsigned long uptime)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* swapoff can easily use up all memory, so kill those first.
|
||||
*/
|
||||
if (p->flags & PF_SWAPOFF)
|
||||
return ULONG_MAX;
|
||||
|
||||
/*
|
||||
* The memory size of the process is the basis for the badness.
|
||||
*/
|
||||
|
@ -230,8 +236,6 @@ static struct task_struct *select_bad_process(unsigned long *ppoints)
|
|||
}
|
||||
if (p->oomkilladj == OOM_DISABLE)
|
||||
continue;
|
||||
if (p->flags & PF_SWAPOFF)
|
||||
return p;
|
||||
|
||||
points = badness(p, uptime.tv_sec);
|
||||
if (points > *ppoints || !chosen) {
|
||||
|
|
Loading…
Reference in a new issue