[SSI] openssi/kernel/cluster/ssi/vproc procfs_subr.c,1.20,1.21

Roger Tsang <[email protected]> Wed, 15 Dec 2010 06:26:02 +0000
Newsgroups gmane.linux.cluster.ssic.cvs
Message-ID <[email protected]>
Update of /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/vproc
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv6730/openssi/kernel/cluster/ssi/vproc

Modified Files:
      Tag: OPENSSI-FC
	procfs_subr.c 
Log Message:
- ssi_get_tgid_list: fix livelock in certain situations when nsc_async_queue() fails. This condition is very rare since nsc_async_queue() rarely fails and would have to fail inside the while block at wait_for_pids label. Regression introduced in CVS tag OPENSSI-FC-1-9-6-PRE49.
- ssi_get_tgid_list_async_handler: ensure contents of proc_readdir_cookie structure is visible on all CPU's before setting its pids_done field.


Index: procfs_subr.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/vproc/procfs_subr.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- procfs_subr.c	25 Oct 2010 05:24:43 -0000	1.20
+++ procfs_subr.c	15 Dec 2010 06:25:59 -0000	1.21
@@ -117,8 +117,8 @@
 			&cp->pids_size, &cp->h_index, &cp->v_index)) {
 		cp->pids_size = 0;
 	}
+	smp_mb(); /* ensure all CPU's see cookie before pids_done */
 	cp->pids_done = 1;
-	smp_mb();
 }
 #endif
 
@@ -208,6 +208,7 @@
 				(void *)data, sizeof(*data), 0)) {
 			list_del(&data->d_list);
 			free_page((unsigned long)data);
+			node = CLUSTERNODE_INVAL; /* skip re-queue */
 			break;
 		}
 
@@ -270,7 +271,7 @@
 					ssi_get_tgid_list_async_handler,
 					(void *)data, sizeof(*data), 0)) {
 				data->pids_size = 0;
-				break;
+				data->pids_done = 1; /* free data */
 			}
 next:
 			if (nr_pids == PROC_MAXPIDS)


------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d