lkml.org 
[lkml]   [2010]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.



\
 
 \ /
  Last update: 2010-12-14 17:27    [W:0.135 / U:0.840 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site