[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070321180713.GA27575@us.ibm.com>
Date: Wed, 21 Mar 2007 11:07:13 -0700
From: sukadev@...ibm.com
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Oleg Nesterov <oleg@...sign.ru>, David Chinner <dgc@....com>,
"Rafael J. Wysocki" <rjw@...k.pl>,
Nigel Cunningham <nigel@...el.suspend2.net>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Jiri Slaby <jirislaby@...il.com>, Pavel Machek <pavel@....cz>,
linux-pm@...ts.osdl.org, linux-kernel@...r.kernel.org
Subject: Re: [linux-pm] 2.6.21-rc4-mm1: freezing of processes broken
Andrew Morton [akpm@...ux-foundation.org] wrote:
| On Wed, 21 Mar 2007 19:55:34 +0300 Oleg Nesterov <oleg@...sign.ru> wrote:
|
| > On 03/21, Andrew Morton wrote:
| > >
| > > On Wed, 21 Mar 2007 15:45:16 +0100 "Rafael J. Wysocki" <rjw@...k.pl> wrote:
| > >
| > > > On Wednesday, 21 March 2007 15:23, Oleg Nesterov wrote:
| > > > > >
| > > > > > Could the freezer code be trying to freeze the idle thread as a result?
| > > > >
| > > > > Yes. remove-the-likelypid-check-in-copy_process.patch make idle threads
| > > > > visible to for_each_process/do_each_thread. Note also that idle threads
| > > > > have ->mm != NULL. freezer, oom_kill, move_task_off_dead_cpu, etc, should
| > > > > not see idle threads, but they do now.
| > > >
| > > > Well, I think this is a good enough reason for asking Andrew to drop this
| > > > patch.
| > >
| > > Or we change the freezer to skip pid==0 tasks.
| >
| > I strongly disagree. In that case we should audit all users of for_each_process.
| > Imho, this change is too dangerous. Actually, I personally think it is very good
| > that idle threads are special and not visible, imho we should not change this.
|
| OK, I'll tentatively drop remove-the-likelypid-check-in-copy_process.patch
Yes. Pls drop it for now. Here is the slightly modified
use-task_pgrp-task_session-in-copy_process.patch
This applies cleanly with remove-the-likelypid-check-in-copy_process.patch
removed.
---
From: Sukadev Bhattiprolu <sukadev@...ibm.com>
Subject: [PATCH] Use task_pgrp() task_session() in copy_process().
Use task_pgrp() and task_session() in copy_process(), and
avoid find_pid() call when attaching the task to its process
group and session.
Signed-off-by: Sukadev Bhattiprolu <sukadev@...ibm.com>
---
kernel/fork.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
Index: lx26-21-rc3-mm2/kernel/fork.c
===================================================================
--- lx26-21-rc3-mm2.orig/kernel/fork.c 2007-03-21 10:51:44.000000000 -0700
+++ lx26-21-rc3-mm2/kernel/fork.c 2007-03-21 10:53:48.000000000 -0700
@@ -1253,14 +1253,11 @@ static struct task_struct *copy_process(
tracehook_init_task(p);
if (thread_group_leader(p)) {
- pid_t pgid = process_group(current);
- pid_t sid = process_session(current);
-
p->signal->tty = current->signal->tty;
- p->signal->pgrp = pgid;
+ p->signal->pgrp = process_group(current);
set_signal_session(p->signal, process_session(current));
- attach_pid(p, PIDTYPE_PGID, find_pid(pgid));
- attach_pid(p, PIDTYPE_SID, find_pid(sid));
+ attach_pid(p, PIDTYPE_PGID, task_pgrp(current));
+ attach_pid(p, PIDTYPE_SID, task_session(current));
list_add_tail_rcu(&p->tasks, &init_task.tasks);
__get_cpu_var(process_counts)++;
-
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