[patch] make oom killer points unsigned long

From: Tim Schmielau
Date: Tue Aug 24 2004 - 10:57:03 EST


Hi Rik,

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.

Tim


Signed-off-by: Tim Schmielau <tim@xxxxxxxxxxxxxxxxxxxxxx>

--- linux-2.6.8.1/mm/oom_kill.c 2004-08-17 21:38:55.000000000 +0200
+++ linux-2.6.8.1-oom/mm/oom_kill.c 2004-08-24 17:40:58.000000000 +0200
@@ -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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/