Re: Attach my own pid

2016-03-27 Thread Nitin Varyani
rather this will also suffice if (* pid == NULL*) { retval = -ENOMEM; pid = alloc_pid(p->nsproxy->pid_ns); if (!pid) goto bad_fork_cleanup_io; } p->pid = pid_nr(pid); On Sun, Mar 27, 2016 at 4:57 PM, Ni

Re: Attach my own pid

2016-03-27 Thread Nitin Varyani
If I do the following thing: struct pid remote_struct_pid; remote_struct_pid.numbers[0].nr=*my_pid*; p = copy_process(clone_flags, stack_start, stack_size, child_tidptr, *remote_struct_pid*, trace, tls); and modify the copy_process function little bit (marked in BOLD), it may serve my objective.

Re: Attach my own pid

2016-03-22 Thread Bernd Petrovitsch
On Die, 2016-03-22 at 01:26 -0400, valdis.kletni...@vt.edu wrote: > On Mon, 21 Mar 2016 16:01:41 +0530, Nitin Varyani said: > > > 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 *"pid"* to > > slave processes r

Re: Attach my own pid

2016-03-22 Thread Mike Krinkin
On Sun, Mar 20, 2016 at 02:07:29AM -0700, Nitin Varyani wrote: > Hi, > The linux kernel attaches a pid to newly forked process. I want to > create a facility by which a process has the option of attaching a new pid > to its child which is not in the pid space. > Any suggestions of how th

Re: Attach my own pid

2016-03-22 Thread Valdis . Kletnieks
On Mon, 21 Mar 2016 16:01:41 +0530, Nitin Varyani said: > 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 *"pid"* to > slave processes running at other computers. The responsibility of the slave > process is to f

Re: Attach my own pid

2016-03-21 Thread Pranay Srivastava
On Mon, Mar 21, 2016 at 4:34 PM, Nitin Varyani wrote: > struct task_struct { > volatile long state; > void *stack; > ... > pid_t pid; > ... > } > You mean to say that just mapping the pid_t pid will do the job. Does the > linux kernel not store pid somewhere else while forking a child? No I mean

Re: Attach my own pid

2016-03-21 Thread Nitin Varyani
struct task_struct { volatile long state; void *stack; ... *pid_t pid;* ... } You mean to say that just mapping the *pid_t pid* will do the job. Does the linux kernel not store pid somewhere else while forking a child? On Mon, Mar 21, 2016 at 4:18 PM, Pranay Srivastava wrote: > Nitin, > > > On

Re: Attach my own pid

2016-03-21 Thread Nitin Varyani
A representative process, that is, a process without any user stack, register values, PC, etc, with *"pid" *is maintained at the master node. Now, the process which was migrated to a remote node, in this example Computer 2, and having process id *"pid", *decides to fork(). It is a system call and i

Re: Attach my own pid

2016-03-21 Thread Nitin Varyani
.Continued 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.

Re: Attach my own pid

2016-03-21 Thread Nitin Varyani
I am trying to create a distributed pid space. 0 to 2000 Computer 1 2001 to 4000 Computer 2 4001 to 6000 Computer 3 and so on... 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 *"pid"* to slave processes running

Re: Attach my own pid

2016-03-20 Thread Valdis . Kletnieks
On Mon, 21 Mar 2016 10:33:44 +0530, Nitin Varyani said: > Sub-task 1: Until now, parent process cannot control the pid of the forked > child. A pid gets assigned as a sequential number by the kernel at the time > the process is forked . I want to modify kernel in such a way that parent > process c

Re: Attach my own pid

2016-03-20 Thread Nitin Varyani
I am reframing my question: Sub-task 1: Until now, parent process cannot control the pid of the forked child. A pid gets assigned as a sequential number by the kernel at the time the process is forked . I want to modify kernel in such a way that parent process can control the pid of the forked chil

Re: Attach my own pid

2016-03-20 Thread Valdis . Kletnieks
On Sun, 20 Mar 2016 02:07:29 -0700, Nitin Varyani said: > The linux kernel attaches a pid to newly forked process. I want to > create a facility by which a process has the option of attaching a new pid > to its child which is not in the pid space. Not at all sure what you mean by "not in the

Attach my own pid

2016-03-20 Thread Nitin Varyani
Hi, The linux kernel attaches a pid to newly forked process. I want to create a facility by which a process has the option of attaching a new pid to its child which is not in the pid space. Any suggestions of how this can be achieved? Nitin ___