Re: [RFC][-mm][PATCH 4/6] oom-killer: fork bomb detector

From: KAMEZAWA Hiroyuki
Date: Mon Nov 02 2009 - 03:41:53 EST


On Mon, 2 Nov 2009 16:27:16 +0900
KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:
> -
> - /* Try to kill a child first */
> + if (fork_bomb) {
> + printk(KERN_ERR "possible fork-bomb is detected. kill them\n");
> + /* We need to kill the youngest one, at least */
> + rcu_read_lock();
> + for_each_process_reverse(c) {
> + if (c == p)
> + break;
> + if (is_forkbomb_family(c, p)) {
> + oom_kill_task(c);
> + break;
> + }
> + }
> + rcu_read_unlock();
> + }

Kosaki said we should kill all under tree and "break" is unnecessay here.
I nearly agree with him..after some experiments.

But it seems the biggest problem is latecy by swap-out...before deciding OOM
....

Thanks,
-Kame

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/