[SSI] openssi/kernel/include/cluster/ssi unix.h,1.18,1.19

Roger Tsang <[email protected]> Sun, 08 Aug 2010 02:27:12 +0000
Newsgroups gmane.linux.cluster.ssic.cvs
Message-ID <[email protected]>
Update of /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv3340/include/cluster/ssi

Modified Files:
      Tag: OPENSSI-FC
	unix.h 
Log Message:
IPC (UNIX domain sockets):
- Implement lockless unixnm_svr_table list traversal. Reduce connect(), sendmsg() contention with bind(), connect(), sendmsg().
- ssi_unix_deregister() do O(1) lookup. Remove release() contention with bind() and various paths with unix_table_lock.
- unixnm_put() do O(1) lookup. Reduce release() contention with bind(), connect(), sendmsg().
- Allocate unixnm_svr_entry and unixnm_cache_entry structures from the Linux slab cache.

 cluster/ssi/ipc/unixnm.c         |  350 ++++++++++++++++++-------------
 include/cluster/ssi/unix.h       |   27 --
 include/net/af_unix.h            |    5 
 net/unix/af_unix.c               |    1 


Index: unix.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/unix.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- unix.h	5 Mar 2010 06:20:46 -0000	1.18
+++ unix.h	8 Aug 2010 02:27:10 -0000	1.19
@@ -313,12 +313,14 @@
 	rmtunix_cache_info(s);
 }
 
+#ifdef SSI_NOTUSED
 /* SSI_XXX: this routine doesn't seem to be called by anyone. Might be a bug */
 static inline void __deprecated
 ssi_unix_decache_info(unix_socket *s)
 {
 	rmtunix_decache_info(s);
 }
+#endif
 
 static inline int
 ssi_unix_sk_comp(unix_socket *sk1, unix_socket *sk2)
@@ -347,11 +349,8 @@
 	err = unixnm_get_byname(sock, name_addr);
 	down_write(&unix_table_lock);
 
-	if (!err) {
-		if (__unix_find_socket_byname(name_addr->name, name_addr->len,
-					      0, name_addr->hash))
-			BUG();
-	}
+	BUG_ON(!err && __unix_find_socket_byname(name_addr->name,
+					name_addr->len, 0, name_addr->hash));
 	return err;
 }
 
@@ -359,28 +358,14 @@
 ssi_unix_deregister(struct socket *sock)
 {
 	struct unix_sock *opts = unix_sk(sock->sk);
-	struct sock *s;
-	struct hlist_node *node;
 
 	/* don't deregister an unbound socket */
 	if (!opts->addr)
 		return;
 
 	/* don't deregister a socket created by accept() */
-	/* SSI_XXX: is there a more efficient way to do this test? */
-	down_read(&unix_table_lock);
-	sk_for_each(s, node, unix_sockets_unbound) {
-		if (s == sock->sk)
-			goto found;
-	}
-	s = NULL;
-found:
-
-	up_read(&unix_table_lock);
-	if (s)
-		return;
-
-	unixnm_put(sock);
+	if (opts->ssi_unixnm_entry)
+		unixnm_put(sock);
 }
 
 #ifdef RMTUNIX_SOCK_INFO_CACHE


------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev