<div dir="ltr">A representative process, that is, a process without any user stack, register values, PC, etc, with <b>"pid" </b>is<b> </b>maintained at the master node. <div>Now, the process which was migrated to a remote node, in this example Computer 2, and having process id <b>"pid", </b>decides to fork(). It is a system call and is forwarded in the same way to master process. This request is forwarded to the representative process with process id <b>"pid"</b>. The representative process forks() leading to a new representative process with process id <b>"cpid". </b>This "cpid" is forwarded to master process which forwards it to slave process. The slave process forwards <b>"cpid"</b> to the remote process with process id <b>"pid"</b>. The remote process with process id <b>"pid"</b> now forks a child and attaches <b>"cpid" </b> to its child.</div><div><br></div><div>This is overview of what I want to achieve. A small correction in my last mail. </div><div><br></div><div><span style="font-size:12.8px">.....Continued.... </span><span style="font-size:12.8px">That is, if kernel at Computer 2 finds that pid of a process requesting a system call is 1500, the request is forwarded to slave daemon which in turn contacts with the master daemon. Master daemon<font color="#ff0000"> forwards this information to corresponding representative process which</font> requests the kernel for the system call and sends the result back to slave daemon.</span><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 21, 2016 at 4:03 PM, Nitin Varyani <span dir="ltr"><<a href="mailto:varyani.nitin1@gmail.com" target="_blank">varyani.nitin1@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">.....Continued.... <span style="font-size:12.8px">That is, if kernel at Computer 2 finds that pid of a process requesting a system call is 1500, the request is forwarded to slave daemon which in turn contacts with the master daemon. Master daemon requests the kernel for the system call and sends the result back to slave daemon.</span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 21, 2016 at 4:01 PM, Nitin Varyani <span dir="ltr"><<a href="mailto:varyani.nitin1@gmail.com" target="_blank">varyani.nitin1@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I am trying to create a distributed pid space.<div><br></div><div>0 to 2000 Computer 1</div><div>2001 to 4000 Computer 2</div><div>4001 to 6000 Computer 3 </div><div><br></div><div>and so on...<br></div><div><br></div><div>I am running a master user-level process at Computer 1 which sends a process context like code, data, registers, PC, etc as well as <b>"pid"</b> to slave processes running at other computers. The responsibility of the slave process is to fork a new process on order of master process and attach <b>"pid" </b>given by the master to the new process it has forked. Any system call on slave nodes will have an initial check of " Whether the process belongs to local node or to the master node?". That is, if kernel at Computer 2 pid of the process is 1500</div><div><br></div><div><br></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 21, 2016 at 12:23 PM, <span dir="ltr"><<a href="mailto:Valdis.Kletnieks@vt.edu" target="_blank">Valdis.Kletnieks@vt.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Mon, 21 Mar 2016 10:33:44 +0530, Nitin Varyani said:<br>
<br>
> Sub-task 1: Until now, parent process cannot control the pid of the forked<br>
> child. A pid gets assigned as a sequential number by the kernel at the time<br>
> the process is forked . I want to modify kernel in such a way that parent<br>
> process can control the pid of the forked child.<br>
<br>
</span>What does controlling the pid gain you? To what purpose?<br>
<span><br>
> Sub-task 2: On Linux, you can find the maximum PID value for your system<br>
> with the following command:<br>
><br>
> $ cat /proc/sys/kernel/pid_max<br>
><br>
> Suppose pid_max=2000 for a system. I want that the parent process should be<br>
> able to assign a pid which is greater that 2000 to the forked child.<br>
<br>
</span>Again, why would you want to do that?<br>
<br>
Anyhow...<br>
<br>
echo 3000 > /proc/sys/kernel/pid_max<br>
fork a process that gets a pid over 2000.<br>
<br>
Done.<br>
<br>
Note that on 32 bit systems, using a pid_max of over 32768 will cause<br>
various things in /proc to blow up.<br>
<br>
I suspect that you need to think harder about what problem you're actually<br>
trying to solve here - what will you do with a controlled child PID? Why does<br>
it even matter?<br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>