| Date | Tue, 14 Dec 2010 17:17:02 +0100 | From | Oleg Nesterov <> | 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.
|