INIT hangs with tonight BK pull (2.6.9-rc1+)
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
Quoted 6 lines · Dmitry Torokhov
After doing BK pull last night INIT gets stuck in
do_tty_hangupafter executing rc.sysinit. Was booting fine with pull from 2 days ago... Anyone else seeing this?
I suspect pidhash patch because it touchedtty_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
Quoted 8 lines
Quoted 6 lines
After doing BK pull last night INIT gets stuck in
do_tty_hangupafter executing rc.sysinit. Was booting fine with pull from 2 days ago... Anyone else seeing this?
I suspect pidhash patch because it touchedtty_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
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 callsdetach_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
Quoted 8 lines
After doing BK pull last night INIT gets stuck in
do_tty_hangupafter 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 */
Quoted 9 lines · Kirill Korotaev
Quoted 8 lines
After doing BK pull last night INIT gets stuck in
do_tty_hangupafter 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