new patches!

risc-a6VBIPemKmirG/[email protected] Fri, 27 Apr 2007 13:53:39 -0500
Newsgroups gmane.linux.cluster.openmosix.devel
Message-ID <[email protected]>
--qMm9M+Fa2AknHoGS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

this is my first set (of three) patches.

this set makes all the "dead code" in the patches apply, and not segfault. in theory, this allows a remote process to be ptraced.. in practice, i have no test code for this.

processes can be migrated away, but cannot return.
returning processes die badly, along with causing a kernel panic on the home node in do_mmap_pgoff, due to the file->f_vfsmnt attached to the VMA area being null.

my next set consists of adding a new debugfs flag for debugging VMA issues, and my third set consists of a hack that makes returning vma segments use a file stub instead of trying to assign the origional file pointer.

set #3 results in processes being able to come home safely, even if they're "damaged".

i will be committing these changes to the subversion in two days if there is no response to this mail.

Julia Longtin <risc-a6VBIPemKmirG/[email protected]>

--qMm9M+Fa2AknHoGS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename="01-ptrace-attach-support_-_cleanup_dead_code.patch"

--- ../anonsvn/openmosix/trunk/2.6/kernel/2.6.17/openmosix/ptrace-attach-support.patch	2007-03-08 21:17:35.000000000 +0000
+++ openmosix/trunk/2.6/kernel/2.6.17/openmosix/ptrace-attach-support.patch	2007-04-26 21:53:09.000000000 +0000
@@ -278,7 +278,7 @@
 ===================================================================
 --- linux.orig/include/hpc/protocol.h	2007-01-05 14:54:20.000000000 +0100
 +++ linux/include/hpc/protocol.h	2007-01-09 19:30:19.000000000 +0100
-@@ -110,6 +110,12 @@
+@@ -110,6 +110,14 @@
  	KCOM_L1_MIG_INIT,	       /* Send to initiate the migration */
  	KCOM_L1_MIG_COME_HOME,	       /* Ask the task to go home        */
  	KCOM_L1_DEP_SIGNAL,            /* Deputy send a signal to remote */
@@ -287,6 +287,8 @@
 +
 +	KCOM_L1_PTRACE_ATTACH,	       /* Notify the remote its attached */
 +	KCOM_L1_PTRACE_CALL,	       /* execute ptrace on deputy       */
++	KCOM_L1_GET_TASK_STATE,	       /*  get the remote task state     */
++	KCOM_L1_SET_TRACED,	       /* called to set to TASK_TRACED   */
 +
  	KCOM_L1_CMD_MAX,
  
@@ -533,7 +535,7 @@
 ===================================================================
 --- linux.orig/hpc/task.c	2007-01-08 19:31:59.000000000 +0100
 +++ linux/hpc/task.c	2007-01-08 19:32:17.000000000 +0100
-@@ -220,22 +220,6 @@
+@@ -223,22 +223,6 @@
  	return 0;
  }
  

--qMm9M+Fa2AknHoGS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename="02-ptrace_check_attach-support_-_cleanup_dead_code.patch"

--- ../anonsvn/openmosix/trunk/2.6/kernel/2.6.17/openmosix/ptrace_check_attach-support.patch	2007-03-08 21:17:35.000000000 +0000
+++ openmosix/trunk/2.6/kernel/2.6.17/openmosix/ptrace_check_attach-support.patch	2007-04-26 19:42:59.000000000 +0000
@@ -14,7 +14,7 @@
 ===================================================================
 --- linux.orig/hpc/kcomd.c	2007-01-10 20:33:31.000000000 +0100
 +++ linux/hpc/kcomd.c	2007-01-10 21:10:40.000000000 +0100
-@@ -346,7 +346,19 @@
+@@ -346,6 +346,19 @@
                  .recv_size = sizeof(int),
  		.name = "Deputy Ptrace Attach"},
  
@@ -25,7 +25,7 @@
 +                .recv_size = 0,
 +                .answer_size = sizeof(struct omp_get_task_state),
 +		.name = "Get Remote Task State"},
-     
++
 +        /* Get the remote task state */
 +	[KCOM_L1_CMD_INDEX(KCOM_L1_SET_TRACED)] = {
 +		.handle_pkt = remote_set_traced,
@@ -47,7 +47,7 @@
  	if (!tsk)
  		return;
  
-@@ -164,3 +164,79 @@
+@@ -164,3 +164,78 @@
  	do_notify_parent_cldstop(p, s->why);
  	return 0;
  }
@@ -59,12 +59,12 @@
 +	struct sockaddr_in *dest_ptr=(void *)child->om.whereto;
 +	int ret;
 +
-+	task = kcom_find_task(child->pid);
++	task = kcom_home_task_find(child->pid);
 +
-+	if (!task || !s)
++	if (!task)
 +		goto notask;
 +
-+	ret = __kcom_send_command(task, KCOM_L1_GET_TASK_STATE, 0, NULL, 0, dest_ptr, &pkt);
++	ret = __kcom_send_command(task, KCOM_L1_GET_TASK_STATE, 0, NULL, 0, dest_ptr, NULL);
 +
 +	if (ret || !pkt)
 +		goto notask;
@@ -97,16 +97,15 @@
 +void deputy_set_remote_traced(struct task_struct *child)
 +{
 +	struct kcom_task *task;
-+	struct kcom_pkt *pkt;
 +	struct sockaddr_in *dest_ptr=(void *)child->om.whereto;
 +	int ret;
 +
 +	task = kcom_home_task_find(child->pid);
 +
-+	if (!task || !s)
++	if (!task)
 +		return;
 +
-+	ret = __kcom_send_command(task, KCOM_L1_SET_TRACED, 0, NULL, 0, dest_ptr, &pkt);
++	ret = __kcom_send_command(task, KCOM_L1_SET_TRACED, 0, NULL, 0, dest_ptr, NULL);
 +}
 +
 +int remote_set_traced(struct kcom_node *node, const struct kcom_pkt *const pkt)

--qMm9M+Fa2AknHoGS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename="03-ptrace_detach-support_-_cleanup_dead_code.patch"

diff -ur ../dev5/openmosix/trunk/2.6/kernel/2.6.17/openmosix/ptrace_detach-support.patch openmosix/trunk/2.6/kernel/2.6.17/openmosix/ptrace_detach-support.patch
--- ../dev5/openmosix/trunk/2.6/kernel/2.6.17/openmosix/ptrace_detach-support.patch	2007-03-08 21:17:35.000000000 +0000
+++ openmosix/trunk/2.6/kernel/2.6.17/openmosix/ptrace_detach-support.patch	2007-04-15 22:26:01.000000000 +0000
@@ -34,23 +34,6 @@
 ===================================================================
 --- linux.orig/hpc/ptrace.c	2007-01-10 22:09:23.000000000 +0100
 +++ linux/hpc/ptrace.c	2007-01-11 14:33:52.000000000 +0100
-@@ -210,7 +210,6 @@
- void deputy_set_remote_traced(struct task_struct *child)
- {
- 	struct kcom_task *task;
--	struct kcom_pkt *pkt;
- 	struct sockaddr_in *dest_ptr=(void *)child->om.whereto;
- 	int ret;
- 
-@@ -219,7 +218,7 @@
- 	if (!task)
- 		return;
- 
--	ret = __kcom_send_command(task, KCOM_L1_SET_TRACED, 0, NULL, 0, dest_ptr, &pkt);
-+	ret = __kcom_send_command(task, KCOM_L1_SET_TRACED, 0, NULL, 0, dest_ptr, NULL);
- }
- 
- int remote_set_traced(struct kcom_node *node, const struct kcom_pkt *const pkt)
 @@ -240,4 +239,45 @@
  	return 0;
  }

--qMm9M+Fa2AknHoGS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="04-kcom_pkt-review_-_cleanup.patch"

--- ../anonsvn/openmosix/trunk/2.6/kernel/2.6.17/openmosix/kcom_pkt-review.patch	2007-03-08 22:17:35.000000000 +0100
+++ openmosix/trunk/2.6/kernel/2.6.17/openmosix/kcom_pkt-review.patch	2007-03-10 05:32:26.000000000 +0100
@@ -6702,7 +6702,7 @@
 ===================================================================
 --- linux.orig/hpc/task.c	2006-12-19 16:56:07.000000000 +0100
 +++ linux/hpc/task.c	2006-12-19 17:00:23.000000000 +0100
-@@ -181,21 +181,42 @@
+@@ -184,21 +184,42 @@
  /**
   * openmosix_task_exit - Exit current task
   **/

--qMm9M+Fa2AknHoGS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename="05-ptrace-cmds-x86_64-support_-_cleanup.patch"

--- ../anonsvn/openmosix/trunk/2.6/kernel/2.6.17/openmosix/ptrace-cmds-x86_64-support.patch	2007-03-08 22:17:35.000000000 +0100
+++ openmosix/trunk/2.6/kernel/2.6.17/openmosix/ptrace-cmds-x86_64-support.patch	2007-03-21 22:31:39.000000000 +0100
@@ -182,7 +182,7 @@
 ===================================================================
 --- linux.orig/hpc/ptrace.c	2007-01-15 15:42:40.000000000 +0100
 +++ linux/hpc/ptrace.c	2007-01-16 18:20:28.000000000 +0100
-@@ -280,4 +280,81 @@
+@@ -279,4 +279,81 @@
  	return 0;
  }
  
@@ -276,8 +276,8 @@
  
  	KCOM_L1_CMD_MAX,
  
-@@ -336,4 +337,14 @@
- 	unsigned long ptrace;
+@@ -330,4 +331,21 @@
+ 	int sig_status;
  };
  
 +
@@ -290,6 +290,13 @@
 +	int set;
 +};
 +
++/* types stolen from include/linux/sched.h */
++struct omp_get_task_state
++{
++  volatile long state;
++  unsigned long ptrace;
++};
++
  #endif /*  _HPC_PROTOCOL_H */
 Index: linux/include/hpc/prototype.h
 ===================================================================

--qMm9M+Fa2AknHoGS
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
--qMm9M+Fa2AknHoGS
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
openMosix-devel mailing list
openMosix-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/openmosix-devel

--qMm9M+Fa2AknHoGS--