[RFC] do_wait() and process state

"Shuveb Hussain" <[email protected]> Tue, 20 Feb 2007 10:33:52 +0530
Newsgroups gmane.linux.cluster.openmosix.devel
Message-ID <[email protected]>
Hi,

When remote processes exit, the deputy exits as well. However there is
an issue once its parent tries to call wait(). In do_wait() the state
and exit_state are derived from the remote's state and exit state.

if (task_test_dflags(p, DDEPUTY)) {
        state = p->om.remote_state;
        exit_state = p->om.remote_exit_state;
}

The remote's process states are never updated in the deputy and thus
the variables state and remote_state are filled with zeros. And zero
means TASK_RUNNING. Since wait() is called on a 'running' process, the
calling process is blocked for ever and the child process remains a
zombie.

Removing this 'if' block solves the issue. The parent does not block
forever and the child exits, but with a segfault. I believe it is
really not a segfault, the kernel segfault handler is not called.
Neither in the remote nor in the deputy, it is just the value that is
returned to the parent that makes it think that the child terminated
due to a segfault.

Can we just transfer the 'state' and 'exit_state' of the process along
with the L2_END_OF_PROCESS message to the deputy? Or do we, on the
deputy side, just set the exit_state/state to EXIT_ZOMBIE/EXIT_DEAD
depending on whether a parent is waiting or not ?

In oM 2.4, there is a LOGICAL_STATE macro defined to figure out the
state of the process and this is derived from task_struct.om.bstate or
the backed up state. Can someone throw more light in this area?

Thanks,
-- 
Shuveb Hussain.
I blog at http://binarykarma.org
Spread the Karma.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV