oom_kill: remove uid==0 checks
[safe/jmp/linux-2.6] / mm / oom_kill.c
index 91a081a..c1850bf 100644 (file)
@@ -125,8 +125,7 @@ unsigned long badness(struct task_struct *p, unsigned long uptime)
         * Superuser processes are usually more important, so we make it
         * less likely that we kill those.
         */
-       if (cap_t(p->cap_effective) & CAP_TO_MASK(CAP_SYS_ADMIN) ||
-                               p->uid == 0 || p->euid == 0)
+       if (__capable(p, CAP_SYS_ADMIN) || __capable(p, CAP_SYS_RESOURCE))
                points /= 4;
 
        /*
@@ -135,7 +134,7 @@ unsigned long badness(struct task_struct *p, unsigned long uptime)
         * tend to only have this flag set on applications they think
         * of as important.
         */
-       if (cap_t(p->cap_effective) & CAP_TO_MASK(CAP_SYS_RAWIO))
+       if (__capable(p, CAP_SYS_RAWIO))
                points /= 4;
 
        /*
@@ -286,7 +285,7 @@ static void __oom_kill_task(struct task_struct *p, int verbose)
         * all the memory it needs. That way it should be able to
         * exit() and clear out its resources quickly...
         */
-       p->time_slice = HZ;
+       p->rt.time_slice = HZ;
        set_tsk_thread_flag(p, TIF_MEMDIE);
 
        force_sig(SIGKILL, p);