<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>&quot;pid&quot;</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>&quot;pid&quot; </b>given by the master to the new process it has forked. Any system call on slave nodes will have an initial check of &quot; Whether the process belongs to local node or to the master node?&quot;. That is, if kernel at Computer 2 pid of the process is 1500</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 21, 2016 at 12:23 PM,  <span dir="ltr">&lt;<a href="mailto:Valdis.Kletnieks@vt.edu" target="_blank">Valdis.Kletnieks@vt.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, 21 Mar 2016 10:33:44 +0530, Nitin Varyani said:<br>
<br>
&gt; Sub-task 1: Until now, parent process cannot control the pid of the forked<br>
&gt; child. A pid gets assigned as a sequential number by the kernel at the time<br>
&gt; the process is forked . I want to modify kernel in such a way that parent<br>
&gt; process can control the pid of the forked child.<br>
<br>
</span>What does controlling the pid gain you?  To what purpose?<br>
<span class=""><br>
&gt; Sub-task 2: On Linux, you can find the maximum PID value for your system<br>
&gt; with the following command:<br>
&gt;<br>
&gt; $ cat /proc/sys/kernel/pid_max<br>
&gt;<br>
&gt; Suppose pid_max=2000 for a system. I want that the parent process should be<br>
&gt; 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 &gt; /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&#39;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>