Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35605
b: refs/heads/master
c: af5b912
h: refs/heads/master
i:
  35603: 5b128f2
v: v3
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed Sep 26, 2006
1 parent ffa78a1 commit fd58a72
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4a3ede107e422a0c53d28024b0aa902ca22a8768
refs/heads/master: af5b912435de32fbede08cee949429823ed49781
8 changes: 6 additions & 2 deletions trunk/mm/oom_kill.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit fd58a72

Please sign in to comment.