[WATCHDOG] sa1100_wdt.c sparse clean (2)
[pandora-kernel.git] / mm / oom_kill.c
index 4748b90..b05ab8f 100644 (file)
@@ -271,9 +271,11 @@ void out_of_memory(gfp_t gfp_mask, int order)
        if (printk_ratelimit()) {
                printk("oom-killer: gfp_mask=0x%x, order=%d\n",
                        gfp_mask, order);
+               dump_stack();
                show_mem();
        }
 
+       cpuset_lock();
        read_lock(&tasklist_lock);
 retry:
        p = select_bad_process();
@@ -284,6 +286,7 @@ retry:
        /* Found nothing?!?! Either we hang forever, or we panic. */
        if (!p) {
                read_unlock(&tasklist_lock);
+               cpuset_unlock();
                panic("Out of memory and no killable processes...\n");
        }
 
@@ -293,6 +296,7 @@ retry:
 
  out:
        read_unlock(&tasklist_lock);
+       cpuset_unlock();
        if (mm)
                mmput(mm);