]> xenbits.xen.org Git - xenclient/kernel.git/commitdiff
imported patch oom-debugging dom0-swap-extra-debugging
authort_jeang <devnull@localhost>
Tue, 6 Jan 2009 12:06:06 +0000 (12:06 +0000)
committert_jeang <devnull@localhost>
Tue, 6 Jan 2009 12:06:06 +0000 (12:06 +0000)
mm/oom_kill.c

index b4643dd38261c6ed0858d02a302eeb15c0ccf124..54ffd8bceb8f0ff140d936a8b152971e337eb061 100644 (file)
@@ -25,7 +25,7 @@
 #include <linux/notifier.h>
 
 int sysctl_panic_on_oom;
-/* #define DEBUG */
+#define DEBUG
 
 /**
  * badness - calculate a numeric value for how bad this task has been
@@ -153,7 +153,7 @@ unsigned long badness(struct task_struct *p, unsigned long uptime)
        }
 
 #ifdef DEBUG
-       printk(KERN_DEBUG "OOMkill: task %d (%s) got %d points\n",
+       printk(KERN_INFO "OOMkill: task %d (%s) got %ld points\n",
        p->pid, p->comm, points);
 #endif
        return points;
@@ -448,6 +448,7 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order, int for
        struct task_struct *p;
        unsigned long points = 0;
        unsigned long freed = 0;
+       int orig_log_level;
 
        blocking_notifier_call_chain(&oom_notify_list, 0, &freed);
        if (freed > 0)
@@ -457,6 +458,9 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order, int for
        if (!should_oom_kill() && !force)
                return;
 
+       orig_log_level = console_loglevel;
+       console_loglevel = 7;
+
        if (printk_ratelimit()) {
                printk(KERN_WARNING "%s invoked oom-killer: "
                "gfp_mask=0x%x, order=%d, oomkilladj=%d\n",
@@ -513,6 +517,8 @@ out:
        read_unlock(&tasklist_lock);
        cpuset_unlock();
 
+       console_loglevel = orig_log_level;
+
        /*
         * Give "p" a good chance of killing itself before we
         * retry to allocate memory unless "p" is current