Skip to contentSkip to conversation

INIT hangs with tonight BK pull (2.6.9-rc1+)

DISCUSSION Dmitry Torokhov 3 participants 6 messages Sep 3, 2004 – Sep 4, 2004

lore
Share & tools
lore
#0 lore raw

Hi,

After doing BK pull last night INIT gets stuck in do_tty_hangup after executing rc.sysinit. Was booting fine with pull from 2 days ago...

Anyone else seeing this?

I suspect pidhash patch because it touched tty_io.c, but I have not tried reverting it as it is getting too late here... So I apologize in advance if I am pointing finger at the innocent ;)

Signature · 1 line
Dmitry
#1 lore raw
Quoted 6 lines · Dmitry Torokhov

After doing BK pull last night INIT gets stuck in do_tty_hangup after executing rc.sysinit. Was booting fine with pull from 2 days ago... Anyone else seeing this?
I suspect pidhash patch because it touched tty_io.c, but I have not tried reverting it as it is getting too late here... So I apologize in advance if I am pointing finger at the innocent ;)

Well, I was excited about blowing away 100B from each task but am now a bit concerned about the semantic impact of the refcounting part of it. It's unclear what pins an ID while a tty has a reference to it without the reference counting; Kirill, could you answer this?

-- wli

#4 lore raw
In reply to Dmitry Torokhov
Quoted 8 lines

After doing BK pull last night INIT gets stuck in do_tty_hangup after executing rc.sysinit. Was booting fine with pull from 2 days ago...

Anyone else seeing this?

I suspect pidhash patch because it touched tty_io.c, but I have not tried reverting it as it is getting too late here... So I apologize in advance if I am pointing finger at the innocent ;)

Oops, you are right. These do_each_task_pid()/while_each_task_pid() do loop 4ever with 'continue' inside. Strange, that I haven't faced the problem on my machine before sending the patch... :(

Sorry for the inconvinience. Patch is inside.

Kirill

include/linux/pid.h renamed from include/linux/pid.h.pid2 +4 -4
@@ -46,10 +46,10 @@ extern void switch_exec_pids(struct task
 		do {
 
 #define while_each_task_pid(who, type, task)				\
-			task = pid_task((task)->pids[type].pid_list.next,\
-						type);			\
-			prefetch((task)->pids[type].pid_list.next);	\
-		} while (hlist_unhashed(&(task)->pids[type].pid_chain));\
+		} while (task = pid_task((task)->pids[type].pid_list.next,\
+						type),			\
+			prefetch((task)->pids[type].pid_list.next),	\
+			hlist_unhashed(&(task)->pids[type].pid_chain));	\
 	}								\
 
 #endif /* _LINUX_PID_H */
#2 lore raw
In reply to William Lee Irwin III
Quoted 8 lines
Quoted 6 lines

After doing BK pull last night INIT gets stuck in do_tty_hangup after executing rc.sysinit. Was booting fine with pull from 2 days ago... Anyone else seeing this?
I suspect pidhash patch because it touched tty_io.c, but I have not tried reverting it as it is getting too late here... So I apologize in advance if I am pointing finger at the innocent ;)

Quoted 4 lines

Well, I was excited about blowing away 100B from each task but am now a bit concerned about the semantic impact of the refcounting part of it. It's unclear what pins an ID while a tty has a reference to it without the reference counting; Kirill, could you answer this?

stop.
tty doesn't hold reference to ID neither in my patch nor in the original kernel.
tty only knows session ID and wants to traverse all tasks with such ID. if task dies it calls detach_pid() and it won't be found in such a loop. No reference counting is required.

The problem was in loop. Or more exactly my do_each_task_pid()/while_each_task_pid() macros were incompatible with continue statement inside. It was really foolish error. Like the most are...

Kirill

#3 lore raw
Quoted 4 lines · Dmitry Torokhov
Quoted 4 lines

Well, I was excited about blowing away 100B from each task but am now a bit concerned about the semantic impact of the refcounting part of it. It's unclear what pins an ID while a tty has a reference to it without the reference counting; Kirill, could you answer this?

Quoted 9 lines · Kirill Korotaev

stop.
tty doesn't hold reference to ID neither in my patch nor in the original kernel.
tty only knows session ID and wants to traverse all tasks with such ID. if task dies it calls detach_pid() and it won't be found in such a loop. No reference counting is required.
The problem was in loop. Or more exactly my do_each_task_pid()/while_each_task_pid() macros were incompatible with continue statement inside. It was really foolish error. Like the most are...

Well, that sounds easy enough to deal with. I suppose the reference counting argument is that the refcounting is on the tty by the tasks and not vice-versa, and disassociate_ctty() cleans up the SID reference.

-- wli

#5 lore raw
In reply to Kirill Korotaev
Quoted 9 lines · Kirill Korotaev
Quoted 8 lines

After doing BK pull last night INIT gets stuck in do_tty_hangup after executing rc.sysinit. Was booting fine with pull from 2 days ago...

Anyone else seeing this?

I suspect pidhash patch because it touched tty_io.c, but I have not tried reverting it as it is getting too late here... So I apologize in advance if I am pointing finger at the innocent ;)

Quoted 6 lines

Oops, you are right. These do_each_task_pid()/while_each_task_pid() do loop 4ever with 'continue' inside.
Strange, that I haven't faced the problem on my machine before sending the patch... :(

Sorry for the inconvinience. Patch is inside.

I see that the patch is already in the kernel proper. Just for the record the patch fixes my problem and the box boots fine. Thanks, Kirill!

Signature · 1 line
Dmitry