X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=mm%2Foom_kill.c;h=3de04b6173c51b474f5ff4110f08d79150d439c9;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=ed0cee4e6c80a09efd3fc9f5d0e7bb05287fa992;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/mm/oom_kill.c b/mm/oom_kill.c index ed0cee4e6..3de04b617 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -54,6 +54,7 @@ static int badness(struct task_struct *p) * The memory size of the process is the basis for the badness. */ points = p->mm->total_vm; + /* add vserver badness ;) */ /* * CPU time is in seconds and run time is in minutes. There is no @@ -220,7 +221,7 @@ retry: /** * out_of_memory - is the system out of memory? */ -void out_of_memory(void) +void out_of_memory(int gfp_mask) { /* * oom_lock protects out_of_memory()'s static variables. @@ -230,12 +231,6 @@ void out_of_memory(void) static unsigned long first, last, count, lastkill; unsigned long now, since; - /* - * Enough swap space left? Not OOM. - */ - if (nr_swap_pages > 0) - return; - spin_lock(&oom_lock); now = jiffies; since = now - last; @@ -245,7 +240,6 @@ void out_of_memory(void) * If it's been a long time since last failure, * we're not oom. */ - last = now; if (since > 5*HZ) goto reset; @@ -278,6 +272,9 @@ void out_of_memory(void) */ lastkill = now; + printk("oom-killer: gfp_mask=0x%x\n", gfp_mask); + show_free_areas(); + /* oom_kill() sleeps */ spin_unlock(&oom_lock); oom_kill();