Re: [patch] openmosix/openmosix-documentation.patch

Florian Delizy <[email protected]> Thu, 02 Nov 2006 11:55:13 +0100
Newsgroups gmane.linux.cluster.openmosix.devel
Message-ID <[email protected]>
I take my chance to answer your first review



> On Mon, Oct 02, 2006 at 06:56:16PM +0200, Florian Delizy wrote:
>   
>>  /**
>> - * 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
>>   **/
>>     
>
> why is that moving the short description into the long description field ?
> specially since the text is the same.
>   
OK, fixed

>   
>> [snip]
>>  /**
>> - * 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
>>   **/
>>     
>
> (same move from short description to long description ..)
> why to document a function parameter if you don't put the documentation
> that come with it ???
>   
true => fixed
>   
>> [snip]
>> 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
>> + **/
>>     
>
> Seems sligtly inaccurate. socket listen create a listening socket...
> the description is quite obvious, so this kind of function doesn't
> really need a kernel-autodoc comment.
>   
I think the value added is in the "and maps it to a file descriptor", 
unless you want to rename it to "socket_listen_map_fd" ?
>   
>>  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;
>>     
>
> Nitpick: it's a documentation patch not, a whitespace patch.
>   
quilt does it that way, and the kernel style ask it this way too.
do you want me to rename the patch "documentation_and_white_space.patch" 
? or make a separate patch to remove this space ? :)
>   
>> +/**
>> + * socket_listen_ip4
>> + *
>> + * Description:
>> + *    IPv4
>> + **/
>>     
>
> pointless description...
>   
=> removed
>   
>>  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
>> + **/
>>     
>
> ditto
>
>   
=> removed
>> +/**
>> + * 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.
>> + **/
>>     
>
> do we really need a comment here as well ?
>
>   
I think it make sense, yes, this one informs of the process, it is not 
mandatory, but it helps understanding
>> +/**
>> + * 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.
>> + **/
>>     
>
> Except that is make reference to some code that is not there yet (which
> means it should had come after the code change, anyway ..),
> I'm appling this one.
>
>   
thanks :)
>> +/**
>> + * mig_send_fp
>> + *
>> + * Description:
>> + *    Sends the process floating point information(?) to the other node.
>> + **/
>>     
>
> I would rather change the name of function to mig_send_floating_point
> instead of documenting such a trivia.
>
> I'm only commiting the kcomd_thread documentation... that's the only
> that seems really useful, all others hooks are NACKed,
>
> Cheers,
>   
Well, some others needed to be integrated IMO, I'll continue to serve 
them in my version, I removed the "long format patches", but not the 
"whitespace" thing, (a warning is a warning, and those patches removes 
quilt warning ...) do you want me to add a "remove quilt white spaces 
warning patch" ?

Still, I took the task of breaking down Matt Dew patch ... but I am not 
responsible for all his code man ;)

I attach a new version of the patch, taking your comments into 
consideration.

I'll resend all patches from the very first to fix the coding standard, 
so you can integrate them one by one, since this seems to be your 
wish... (this just adds some more traffic to the ML :) )

BTW2, can you tell me which part you added to git, and which not please, 
that would help me maintaining my quilt tree...

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
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, 5.6 KB)
[patch @num@/@total@] Documentation for openmosix

Improves the openmosix internal documentation (using kdoc)

This version of the patch takes last comments form Vincent Hanquez
Index: linux/hpc/copyuser.c
===================================================================
--- linux.orig/hpc/copyuser.c	2006-11-02 11:46:33.000000000 +0100
+++ linux/hpc/copyuser.c	2006-11-02 11:50:40.000000000 +0100
@@ -22,6 +22,9 @@
 
 /**
  * deputy_copy_from_user - Copy from remote when running on deputy
+ * @to:     kernelspace address to copy to
+ * @from:   userspace address to copy from
+ * @n:      size of data to copy
  **/
 unsigned long deputy_copy_from_user(void *to, const void __user *from, unsigned long n)
 {
@@ -53,6 +56,9 @@
 
 /**
  * deputy_strncpy_from_user - strncpy on remote when running on deputy
+ * @dst:     kernelspace address to copy to
+ * @src:   userspace address to copy from
+ * @count:      size of data to copy
  **/
 unsigned long deputy_strncpy_from_user(char *dst, const char __user *src,
 							long count)
@@ -80,6 +86,9 @@
 
 /**
  * deputy_copy_to_user - copy to remote when running on deputy
+ * @to:     userspace address to copy to
+ * @from:   kernelspace address to copy from
+ * @count:      size of data to copy
  **/
 unsigned long deputy_copy_to_user(void __user *to, const void *from, unsigned long n)
 {
Index: linux/hpc/kcomd.c
===================================================================
--- linux.orig/hpc/kcomd.c	2006-11-02 11:46:33.000000000 +0100
+++ linux/hpc/kcomd.c	2006-11-02 11:51:28.000000000 +0100
@@ -21,11 +21,14 @@
 #include <net/sock.h>
 #include <net/tcp.h>
 
+/**
+ * socket_listen - 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;
@@ -96,7 +99,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 +196,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 +232,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 +281,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 +308,7 @@
 		kctask->pid = pid;
 		kctask->node = node;
 		INIT_LIST_HEAD(&kctask->list);
-		
+
 		list_add(&kctask->list, &node->tasks);
 	}
 	return kctask;
@@ -337,7 +357,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 +366,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 +414,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/migsend.c
===================================================================
--- linux.orig/hpc/migsend.c	2006-11-02 11:46:33.000000000 +0100
+++ linux/hpc/migsend.c	2006-11-02 11:54:44.000000000 +0100
@@ -80,6 +80,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;
@@ -108,6 +115,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 +150,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 +187,10 @@
 }
 
 
+/**
+ * mig_send_proc_context - Sends the 'important' part of the process context.
+ *
+ **/
 static int mig_send_proc_context(task_t *p)
 {
 	struct omp_mig_task m;
@@ -220,6 +246,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);