]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - mm/oom_kill.c
ath5k: dont use external sleep clock in AP mode
[karo-tx-linux.git] / mm / oom_kill.c
index 372692294844ea280524f753d7269cfaf8e19f3f..83cd9bb55092afd3bd18bdc2e1cce7888aa8c7a2 100644 (file)
@@ -373,11 +373,6 @@ static void __oom_kill_task(struct task_struct *p, int verbose)
 
 static int oom_kill_task(struct task_struct *p)
 {
-       struct mm_struct *mm;
-       struct task_struct *g, *q;
-
-       mm = p->mm;
-
        /* WARNING: mm may not be dereferenced since we did not obtain its
         * value from get_task_mm(p).  This is OK since all we need to do is
         * compare mm to q->mm below.
@@ -386,21 +381,11 @@ static int oom_kill_task(struct task_struct *p)
         * change to NULL at any time since we do not hold task_lock(p).
         * However, this is of no concern to us.
         */
-       if (!mm || p->signal->oom_adj == OOM_DISABLE)
+       if (!p->mm || p->signal->oom_adj == OOM_DISABLE)
                return 1;
 
        __oom_kill_task(p, 1);
 
-       /*
-        * kill all processes that share the ->mm (i.e. all threads),
-        * but are in a different thread group. Don't let them have access
-        * to memory reserves though, otherwise we might deplete all memory.
-        */
-       do_each_thread(g, q) {
-               if (q->mm == mm && !same_thread_group(q, p))
-                       force_sig(SIGKILL, q);
-       } while_each_thread(g, q);
-
        return 0;
 }
 
@@ -419,7 +404,7 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
                cpuset_print_task_mems_allowed(current);
                task_unlock(current);
                dump_stack();
-               mem_cgroup_print_oom_info(mem, current);
+               mem_cgroup_print_oom_info(mem, p);
                show_mem();
                if (sysctl_oom_dump_tasks)
                        dump_tasks(mem);
@@ -441,6 +426,8 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
        list_for_each_entry(c, &p->children, sibling) {
                if (c->mm == p->mm)
                        continue;
+               if (mem && !task_in_mem_cgroup(c, mem))
+                       continue;
                if (!oom_kill_task(c))
                        return 0;
        }