[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101214161702.GF11400@redhat.com>
Date: Tue, 14 Dec 2010 17:17:02 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: "Suzuki K. Poulose" <suzuki@...ibm.com>
Cc: linux-kernel@...r.kernel.org,
Jeremy Fitzhardinge <jeremy.fitzhardinge@...rix.com>,
Christoph Hellwig <hch@....de>,
Masami Hiramatsu <mhiramat@...hat.com>,
Ananth N Mavinakayanahalli <ananth@...ibm.com>,
Daisuke HATAYAMA <d.hatayama@...fujitsu.com>,
Andi Kleen <andi@...stfloor.org>,
Roland McGrath <roland@...hat.com>,
Amerigo Wang <amwang@...hat.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [Patch 13/21] Freeze / Thaw threads
On 12/14, Suzuki K. Poulose wrote:
>
> @@ -148,6 +159,21 @@ static int open_gencore(struct inode *in
> list_add(&cp->list, &core_list);
> mutex_unlock(&core_mutex);
>
> + /* freeze the processes */
> + t = task;
> + read_lock(&tasklist_lock);
> + do {
> + if (frozen(t) || !freezeable(t) || freezing(t))
> + continue;
> +
> + if (freeze_task(t, true))
> + continue;
> +
> + if (task_is_stopped_or_traced(t))
> + continue;
> + } while ((t = next_thread(t)) != task);
> + read_unlock(&tasklist_lock);
Ooooh. Sorry, I dislike this approach very much.
Firstly, I can't understand why this can't race with the kernel
doing freeze/thaw.
But the main problem is: these series adds the new and nice way
to create the unkillable processes. This can't be good.
Say, until you close this file, even oom-killer can't kill it.
It is easy to DoS the system. Just fork the new processes which
use the memory and freeze them.
And, given that we have to handle task_is_stopped_or_traced()
tasks correctly anyway, I think gencore should rely on STOPPED/
TRACED and doesn't use freezer at all.
> + } while ((t = next_thread(t)) != task);
while_each_thread()
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists