aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorTim Schmielau <tim@physik3.uni-rostock.de>2004-08-26 20:42:51 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-26 20:42:51 -0700
commitc9bee9d91b1bc1f6a2e6aace13852d3a6cb89797 (patch)
tree9111441b49cc68dd4de2e7f2e5c6c3c896baefa2 /mm
parent84a9d1e225868703873966372953d903de787bbb (diff)
downloadhistory-c9bee9d91b1bc1f6a2e6aace13852d3a6cb89797.tar.gz
[PATCH] make oom killer points unsigned long
It seems a little unsafe to me to have oom killer badness points of type int, when all the underlying objects are unsigned long. I can't immediately think of a case where this matters much, but e.g. a long-running job or daemon on a 64 bit machine might lose it's bonus because of that. Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/oom_kill.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 9bcd259f0bc474..48f6dde410b342 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -41,9 +41,9 @@
* of least surprise ... (be careful when you change it)
*/
-static int badness(struct task_struct *p)
+static unsigned long badness(struct task_struct *p)
{
- int points, cpu_time, run_time, s;
+ unsigned long points, cpu_time, run_time, s;
if (!p->mm)
return 0;
@@ -108,13 +108,13 @@ static int badness(struct task_struct *p)
*/
static struct task_struct * select_bad_process(void)
{
- int maxpoints = 0;
+ unsigned long maxpoints = 0;
struct task_struct *g, *p;
struct task_struct *chosen = NULL;
do_each_thread(g, p)
if (p->pid) {
- int points = badness(p);
+ unsigned long points = badness(p);
if (points > maxpoints) {
chosen = p;
maxpoints = points;