===== mm/oom_kill.c 1.29 vs edited ===== --- 1.29/mm/oom_kill.c 2004-08-27 00:02:36 -07:00 +++ edited/mm/oom_kill.c 2004-11-15 16:02:34 -08:00 @@ -83,7 +83,7 @@ */ if (cap_t(p->cap_effective) & CAP_TO_MASK(CAP_SYS_ADMIN) || p->uid == 0 || p->euid == 0) - points /= 4; + points /= 10; /* * We don't want to kill a process with direct hardware access. @@ -113,7 +113,7 @@ struct task_struct *chosen = NULL; do_each_thread(g, p) - if (p->pid) { + if (p->pid && !(p->state & TASK_ZOMBIE)) { unsigned long points = badness(p); if (points > maxpoints) { chosen = p; @@ -148,7 +148,7 @@ * all the memory it needs. That way it should be able to * exit() and clear out its resources quickly... */ - p->time_slice = HZ; + p->time_slice = 5 * HZ; p->flags |= PF_MEMALLOC | PF_MEMDIE; /* This process has hardware access, be more careful. */ @@ -234,28 +234,6 @@ now = jiffies; since = now - last; last = now; - - /* - * If it's been a long time since last failure, - * we're not oom. - */ - if (since > 5*HZ) - goto reset; - - /* - * If we haven't tried for at least one second, - * we're not really oom. - */ - since = now - first; - if (since < HZ) - goto out_unlock; - - /* - * If we have gotten only a few failures, - * we're not really oom. - */ - if (++count < 10) - goto out_unlock; /* * If we just killed a process, wait a while