x86, mm: Change cachemode exports to non-gpl
[cascardo/linux.git] / mm / oom_kill.c
index 3b014d3..d503e9c 100644 (file)
@@ -233,7 +233,7 @@ static enum oom_constraint constrained_alloc(struct zonelist *zonelist,
        /* Check this allocation failure is caused by cpuset's wall function */
        for_each_zone_zonelist_nodemask(zone, z, zonelist,
                        high_zoneidx, nodemask)
-               if (!cpuset_zone_allowed_softwall(zone, gfp_mask))
+               if (!cpuset_zone_allowed(zone, gfp_mask))
                        cpuset_limited = true;
 
        if (cpuset_limited) {
@@ -281,14 +281,9 @@ enum oom_scan_t oom_scan_process_thread(struct task_struct *task,
        if (oom_task_origin(task))
                return OOM_SCAN_SELECT;
 
-       if (task->flags & PF_EXITING && !force_kill) {
-               /*
-                * If this task is not being ptraced on exit, then wait for it
-                * to finish before killing some other task unnecessarily.
-                */
-               if (!(task->group_leader->ptrace & PT_TRACE_EXIT))
-                       return OOM_SCAN_ABORT;
-       }
+       if (task_will_free_mem(task) && !force_kill)
+               return OOM_SCAN_ABORT;
+
        return OOM_SCAN_OK;
 }
 
@@ -443,7 +438,7 @@ void oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
         * If the task is already exiting, don't alarm the sysadmin or kill
         * its children or threads, just set TIF_MEMDIE so it can die quickly
         */
-       if (p->flags & PF_EXITING) {
+       if (task_will_free_mem(p)) {
                set_tsk_thread_flag(p, TIF_MEMDIE);
                put_task_struct(p);
                return;
@@ -649,7 +644,7 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask,
         * select it.  The goal is to allow it to allocate so that it may
         * quickly exit and free its memory.
         */
-       if (fatal_signal_pending(current) || current->flags & PF_EXITING) {
+       if (fatal_signal_pending(current) || task_will_free_mem(current)) {
                set_thread_flag(TIF_MEMDIE);
                return;
        }