[patch] openmosix/openmosix-documentation.patch

Florian Delizy <[email protected]> Mon, 02 Oct 2006 18:56:16 +0200
Newsgroups gmane.linux.cluster.openmosix.devel
Message-ID <[email protected]>
As tab asked, I am going to send one by one the patch so they can be 
reviewed, and integrated on the git repository.

So here it is, this is a trivial patch that adds some documentation (and 
only documentation)

Tab, waiting for your comments on this one please.

Florian

-------------------------------------------------------------------------
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

_______________________________________________
openMosix-devel mailing list
openMosix-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/openmosix-devel
openmosix-documentation.patch (text/x-patch, 10.7 KB)
Index: linux/hpc/copyuser.c
===================================================================
--- linux.orig/hpc/copyuser.c	2006-09-28 14:53:08.000000000 +0200
+++ linux/hpc/copyuser.c	2006-09-28 14:53:30.000000000 +0200
@@ -21,7 +21,13 @@
 /********** DEPUTY PART **********/
 
 /**
- * deputy_copy_from_user - Copy from remote when running on deputy
+ * deputy_copy_from_user -
+ * @to:     kernelspace address to copy to
+ * @from:   userspace address to copy from
+ * @n:      size of data to copy
+ *
+ * Description:
+ *    Copy from remote when running on deputy
  **/
 unsigned long deputy_copy_from_user(void *to, const void __user *from, unsigned long n)
 {
@@ -52,7 +58,13 @@
 EXPORT_SYMBOL(deputy_copy_from_user);
 
 /**
- * deputy_strncpy_from_user - strncpy on remote when running on deputy
+ * deputy_strncpy_from_user
+ * @dst:     kernelspace address to copy to
+ * @src:   userspace address to copy from
+ * @count:      size of data to copy
+ *
+ * Description:
+ *    strncpy on remote when running on deputy
  **/
 unsigned long deputy_strncpy_from_user(char *dst, const char __user *src,
 							long count)
@@ -79,7 +91,13 @@
 }
 
 /**
- * deputy_copy_to_user - copy to remote when running on deputy
+ * deputy_copy_to_user -
+ * @to:     userspace address to copy to
+ * @from:   kernelspace address to copy from
+ * @count:      size of data to copy
+ *
+ * Description:
+ *    copy to remote when running on deputy
  **/
 unsigned long deputy_copy_to_user(void __user *to, const void *from, unsigned long n)
 {
@@ -110,7 +128,12 @@
 EXPORT_SYMBOL(deputy_copy_to_user);
 
 /**
- * deputy_strnlen_user - strnlen on remote when running on deputy
+ * deputy_strnlen_user -
+ * @s:     string address
+ * @n:     size
+ *
+ * Description:
+ *    strnlen on remote when running on deputy
  **/
 unsigned long deputy_strnlen_user(const char *s, long n)
 {
@@ -138,7 +161,13 @@
 EXPORT_SYMBOL(deputy_strnlen_user);
 
 /**
- * deputy_put_userX - put a value of 64 bit or less to remote
+ * deputy_put_userX
+ * @value:
+ * @addr:
+ * @size:
+ *
+ * Description:
+ *    put a value of 64 bit or less to remote
  **/
 static inline long deputy_put_userX(s64 value, const void *addr, size_t size)
 {
@@ -161,7 +190,13 @@
 }
 
 /**
- * deputy_put_user - put a long value to remote
+ * deputy_put_user
+ * @value:
+ * @addr:
+ * @size:
+ *
+ * Description:
+ *    put a long value to remote
  **/
 long deputy_put_user(long value, const void *addr, size_t size)
 {
@@ -172,7 +207,13 @@
 
 #if BITS_PER_LONG < 64
 /**
- * deputy_put_user - put a 64 bit value to remote
+ * deputy_put_user
+ * @value:
+ * @addr:
+ * @size:
+ *
+ * Description:
+ *    put a long value to remote
  **/
 long deputy_put_user64(s64 value, const void *addr)
 {
Index: linux/hpc/kcomd.c
===================================================================
--- linux.orig/hpc/kcomd.c	2006-09-28 14:53:08.000000000 +0200
+++ linux/hpc/kcomd.c	2006-09-28 14:53:30.000000000 +0200
@@ -21,11 +21,17 @@
 #include <net/sock.h>
 #include <net/tcp.h>
 
+/**
+ * socket_listen
+ *
+ * Description:
+ *    Creates the network socket and maps it to a file descriptor
+ **/
 static int socket_listen(struct sockaddr *saddr, struct socket **res)
 {
 	struct socket *sock;
 	int ret, fd;
-	
+
 	ret = sock_create(saddr->sa_family, SOCK_STREAM, IPPROTO_TCP, &sock);
 	if (ret < 0)
 		return -1;
@@ -51,6 +57,12 @@
 	return -1;
 }
 
+/**
+ * socket_listen_ip4
+ *
+ * Description:
+ *    IPv4
+ **/
 static int socket_listen_ip4(int port, struct socket **res)
 {
 	struct sockaddr_in saddr4 = {
@@ -62,6 +74,12 @@
 	return socket_listen((struct sockaddr *) &saddr4, res);
 }
 
+/**
+ * socket_listen_ip6
+ *
+ * Description:
+ *    IPv6
+ **/
 static int socket_listen_ip6(int port, struct socket **res)
 {
 	struct sockaddr_in6 saddr6 = {
@@ -96,7 +114,7 @@
 	pid_t pid;              /* pid of the process owning this struct */
 	struct kcom_node *node; /* node of the process to send/recv */
 	struct list_head list;  /* list of process using some node */
-	
+
 	struct list_head out_packs;
 	struct kcom_pkt in_packs;
 };
@@ -193,7 +211,7 @@
 	ret = sock->ops->getname
 	check if it's already in node list.
 	*/
-	
+
 	spin_lock(&kcom_nodes_lock);
 	list_add(&node->list, &kcom_nodes);
 	spin_unlock(&kcom_nodes_lock);
@@ -229,6 +247,15 @@
 int comm_iovec(void);
 int comm_iovec_ack(void);
 
+/**
+ * accept_connection
+ *
+ * Description:
+ *    Once kcomd's sockets receive a new connection attempt,
+ *    the connection is accepted, the remote IP address is
+ *    retrieved, the file descriptor is mapped and the
+ *    kcom node is created with this information.
+ **/
 static int accept_connection(struct socket *lsock)
 {
 	struct socket *sock;
@@ -269,6 +296,14 @@
 	return 0;
 }
 
+/**
+ * data_write
+ *
+ * Description:
+ *    Loops through all tasks that have processes on the node that
+ *    has data to send, and sends the pkts.
+ *    Once the pkt has been sent, its memory is freed.
+ **/
 int data_write(struct kcom_node *node)
 {
 	return 0;
@@ -288,7 +323,7 @@
 		kctask->pid = pid;
 		kctask->node = node;
 		INIT_LIST_HEAD(&kctask->list);
-		
+
 		list_add(&kctask->list, &node->tasks);
 	}
 	return kctask;
@@ -337,7 +372,7 @@
 	tsk = kcom_task_find(pid);
 	if (!tsk)
 		return -ENODEV;
-	
+
 	/* put pkt in kcom_task */
 	pkt = kcom_pkt_create(0, 0, NULL);
 	if (!pkt)
@@ -346,11 +381,24 @@
 
 	/* go to sleep */
 	/* wait reply */
-	
+
 	return 0;
 }
 
 
+/**
+ * kcomd_thread
+ *
+ * Description:
+ *    kcomd - kernel thread that handles the communications.
+ *    Creates the memory slabs.
+ *    Once the pkt has been sent, its memory is freed.
+ *    Maps new connections to file descriptors.
+ *    Waits for incoming data, signals from processes
+ *    or any data that is ready to be sent.
+ *    Also cleans up memory and any open sockets and
+ *    file descriptors on exit.
+ **/
 static int kcomd_thread(void *nothing)
 {
 	int ret;
@@ -381,7 +429,7 @@
 		zero_fd_set(n, sockets_fds.in);
 		zero_fd_set(n, sockets_fds.out);
 		zero_fd_set(n, sockets_fds.ex);
-	
+
 		/* add listening sockets to the set */
 		set_bit(fd4, sockets_fds.in);
 		set_bit(fd6, sockets_fds.in);
Index: linux/hpc/migctrl.c
===================================================================
--- linux.orig/hpc/migctrl.c	2006-09-28 14:53:08.000000000 +0200
+++ linux/hpc/migctrl.c	2006-09-28 14:53:30.000000000 +0200
@@ -31,8 +31,11 @@
 #include <hpc/protocol.h>
 
 /**
- * task_remote_expel - call from REMOTE to send a task to DEPUTY
+ * task_remote_expel
  * @p:		task which will come back
+ *
+ * Description:
+ *    Call from REMOTE to send a task to DEPUTY
  **/
 int task_remote_expel(task_t *p)
 {
@@ -58,8 +61,11 @@
 }
 
 /**
- * task_remote_wait_expel - call from REMOTE to send a task to DEPUTY
+ * task_remote_wait_expel
  * @p:		task which will come back
+ *
+ * Description:
+ *    Call from REMOTE to send a task to DEPUTY
  **/
 int task_remote_wait_expel(task_t *p)
 {
@@ -80,10 +86,13 @@
 }
 
 /**
- * task_local_send - Send a local task to remote
+ * task_local_send
  * @p:		task to send
  * @whereto:	destination sockaddr
  * @reason:	reason to send there (if any)
+ *
+ * Description:
+ *    Send a local task to remote
  **/
 static int task_local_send(task_t *p, struct sockaddr *whereto, int reason)
 {
@@ -127,9 +136,12 @@
 
 
 /**
- * task_local_bring - Receive task back in the deputy stub
+ * task_local_bring
  * @p:		deputy task to receive
  * @reason:	reason to send (if any)
+ *
+ * Description:
+ *    Receive task back in the deputy stub
  **/
 static int task_local_bring(task_t *p, int reason)
 {
@@ -166,10 +178,13 @@
 }
 
 /**
- * task_move_remote2remote - migrate a task from remote to remote
+ * task_move_remote2remote
  * @p:		task to send
  * @whereto:	whereto
  * @reason:	reason to send (if any)
+ *
+ * Description:
+ *    Migrate a task from remote to remote
  **/
 static int task_move_remote2remote(task_t *p, struct sockaddr * whereto,
 								int reason)
@@ -179,10 +194,13 @@
 }
 
 /**
- * task_move_to_node - send a task to a node
+ * task_move_to_node
  * @p:		task to send
  * @whereto:	destination sockaddr
  * @reason:	why
+ *
+ * Description:
+ *    Send a task to a node
  **/
 static int __task_move_to_node(struct task_struct *p,
                                struct sockaddr * whereto,
@@ -217,8 +235,14 @@
 }
 
 /**
- * task_go_home - Migrate task to home
- **/
+ * task_go_home
+ * @p:		task to send
+ * @whereto:	destination sockaddr
+ * @reason:	why
+ *
+ * Description:
+ *    Migrate task to home
+**/
 int task_go_home(task_t *p)
 {
 	if (!task_test_dflags(p, DMIGRATED)) {
@@ -235,7 +259,12 @@
 }
 
 /**
- * task_go_home_for_reason - Migrate back a task for a reason
+ * task_go_home_for_reason
+ * @p:		task to send
+ * @reason:	why
+ *
+ * Description:
+ *    Migrate back a task for a reason
  **/
 int task_go_home_for_reason(task_t *p, int reason)
 {
Index: linux/hpc/migsend.c
===================================================================
--- linux.orig/hpc/migsend.c	2006-09-28 14:53:08.000000000 +0200
+++ linux/hpc/migsend.c	2006-09-28 14:53:30.000000000 +0200
@@ -68,6 +68,12 @@
 	return 0;
 }
 
+/**
+ * mig_send_fp
+ *
+ * Description:
+ *    Sends the process floating point information(?) to the other node.
+ **/
 static int mig_send_fp(task_t *p)
 {
 	struct omp_mig_fp m;
@@ -80,6 +86,13 @@
 }
 
 
+/**
+ * mig_send_mm
+ *
+ * Description:
+ *    Sends the process memory map information to the other node.
+ *    Wait for an acknowledgement
+ **/
 static int mig_send_mm(task_t *p)
 {
 	struct omp_mig_mm s;
@@ -89,6 +102,13 @@
 	return comm_send_hd(p->om.contact, MIG_MM, &s, sizeof(s));
 }
 
+/**
+ * mig_send_vma_file
+ *
+ * Description:
+ *    Called by mig_send_vmas.
+ *    FIXME:  file vmas ??
+ **/
 static inline void mig_send_vma_file(task_t *p, struct vm_area_struct *vma,
 							struct omp_mig_vma *m)
 {
@@ -108,6 +128,14 @@
 	}
 }
 
+/**
+ * mig_send_vmas
+ *
+ * Description:
+ *    loops through and sends all process vmas to the other node.
+ *    vma's are the virtual memory structs.  They hold the lists of
+ *    mapped pages and page permissions.
+ **/
 static int mig_send_vmas(task_t *p)
 {
 	struct vm_area_struct *vma;
@@ -135,6 +163,13 @@
 }
 
 
+/**
+ * mig_send_pages
+ *
+ * Description:
+ *    loops through and sends all process pages to the other node.
+ *    All the process's memory space is sent, one page at a time.
+ **/
 static int mig_send_pages(task_t *p)
 {
 	struct vm_area_struct * vma;
@@ -165,6 +200,13 @@
 }
 
 
+/**
+ * mig_send_proc_context
+ *
+ * Description:
+ *    Sends the 'important' part of the process context.
+ *
+ **/
 static int mig_send_proc_context(task_t *p)
 {
 	struct omp_mig_task m;
@@ -220,6 +262,13 @@
 	return -1;
 }
 
+/**
+ * mig_do_send
+ *
+ * Description:
+ *    Main loop for sending the process to the other node.
+ *
+ **/
 int mig_do_send(task_t *p)
 {
 	arch_mig_send_pre(p);