[SSI] openssi/kernel/include/cluster/ssi load_level.h, 1.9, 1.10 ssidev.h, 1.12, 1.13 unix.h, 1.13, 1.14

Roger Tsang <[email protected]>
Newsgroups gmane.linux.cluster.ssic.cvs
Message-ID <[email protected]>
Update of /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi
In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8553/include/cluster/ssi

Modified Files:
      Tag: OPENSSI-FC
	load_level.h ssidev.h unix.h 
Log Message:
Bug fixes and enhancements. (see ChangeLog)


Index: load_level.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/load_level.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- load_level.h	20 Apr 2008 05:49:24 -0000	1.9
+++ load_level.h	3 Feb 2009 06:18:13 -0000	1.10
@@ -52,14 +52,23 @@
 struct inclusion_list {
 	struct dentry *de;
 	struct vfsmount *mnt;
+#ifdef LOADLEVEL_TABLE_LIST
+	struct list_head inc_list;
+#else
 	struct inclusion_list *next;
+#endif
 };
 
 extern load_array_t master_load_array[NSC_MAX_NODE_VALUE + 1];
 extern int load_cnt;
 extern int loadlevel_on;
+#ifdef LOADLEVEL_TABLE_LIST
+extern struct list_head loadlevel_table;
+extern RW_LOCK_T loadlevellist_lock;
+#else
 extern struct inclusion_list *loadlevel_table;
 extern LOCK_T loadlevellst_lock;
+#endif
 
 extern int rexec_loadtable[NSC_MAX_NODE_VALUE + 1];
 extern int ssi_roundrobin;
@@ -68,6 +77,22 @@
 /*
  * LOCK macros used for loadleveling...
  */
+#ifdef LOADLEVEL_TABLE_LIST
+#define LOADLIST_LOCK_INIT() \
+	INIT_RW_LOCK(&loadlevellist_lock)
+
+#define LOADLIST_LOCK() \
+	LOCK_EXCL_RW_LOCK(&loadlevellist_lock)
+
+#define LOADLIST_UNLOCK() \
+	UNLOCK_EXCL_RW_LOCK(&loadlevellist_lock)
+
+#define LOADLIST_LOCK_SHARED() \
+	LOCK_SHR_RW_LOCK(&loadlevellist_lock)
+
+#define LOADLIST_UNLOCK_SHARED() \
+	UNLOCK_SHR_RW_LOCK(&loadlevellist_lock)
+#else /* !LOADLEVEL_TABLE_LIST */
 #define LOADLIST_LOCK_INIT() \
 	INIT_LOCK(&loadlevellist_lock)
 
@@ -79,6 +104,7 @@
 
 #define TRY_LOADLIST_LOCK() \
 	TRY_LOCK_LOCK(&loadlevellist_lock)
+#endif /* !LOADLEVEL_TABLE_LIST */
 
 #ifdef CONFIG_MOSIX_LL
 extern void cleanup_load(clusternode_t);

Index: unix.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/unix.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- unix.h	10 Oct 2008 08:10:33 -0000	1.13
+++ unix.h	3 Feb 2009 06:18:13 -0000	1.14
@@ -258,6 +258,10 @@
 {
 	if (!rmtunix_ismagic(s))
 		sock_hold(s);
+#ifdef IPC_STALE_RMTUNIX_CACHE_FIX
+	else
+		atomic_inc(&((struct rmtunix_socket_info *)s)->rsk_refcnt);
+#endif
 }
 
 static inline void
@@ -265,9 +269,41 @@
 {
 	if (!rmtunix_ismagic(s)) {
 		sock_put(s);
+#ifndef IPC_STALE_RMTUNIX_CACHE_FIX
 	} else if (freeinfo && !rmtunix_iscached(s)) {
+		/* SSI_XXX: Race with rmtunix_decache_info */
 		rmtunix_clrmagic(s);
 		kfree(s);
+#else
+	} else if (freeinfo) {
+		struct rmtunix_socket_info *info =
+				(struct rmtunix_socket_info *) s;
+
+		might_sleep();
+		if (!atomic_dec_and_lock(&info->rsk_refcnt, &rmtunix_cache_listlock))
+			return;
+		spin_lock(&s->sk_lock.slock);
+		if (!info->rsk_cached) {
+			spin_unlock(&s->sk_lock.slock);
+			spin_unlock(&rmtunix_cache_listlock);
+			return;
+		}
+		info->rsk_cached = 0;
+		spin_unlock(&s->sk_lock.slock);
+#ifdef RCU_RMTUNIX_CACHE
+		list_del_rcu(&info->list);
+#else
+		list_del(&info->list);
+#endif
+		spin_unlock(&rmtunix_cache_listlock);
+
+#ifdef RCU_RMTUNIX_CACHE
+		call_rcu(&info->rhead, rmtunix_dealloc);
+#else
+		rmtunix_clrmagic(s);
+		kfree(s);
+#endif
+#endif /* IPC_STALE_RMTUNIX_CACHE_FIX */
 	}
 }
 
@@ -302,8 +338,7 @@
 }
 
 /* SSI_XXX: this routine doesn't seem to be called by anyone. Might be a bug */
-/* Called by rmtunixsvr_release_rmtpair() */
-static inline void
+static inline void __deprecated
 ssi_unix_decache_info(unix_socket *s)
 {
 	rmtunix_decache_info(s);
@@ -433,7 +468,7 @@
 	int err;
 
 	if (*other)
-		return !!rmtunix_ismagic(*other);
+		return rmtunix_ismagic(*other);
 
 	err = -ECONNRESET;
 	if (!sunname)

Index: ssidev.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/ssidev.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- ssidev.h	23 Apr 2005 04:50:24 -0000	1.12
+++ ssidev.h	3 Feb 2009 06:18:13 -0000	1.13
@@ -86,6 +86,10 @@
 
 typedef struct {
 	struct list_head	pc_list;
+#ifdef RCU_SSIDEV_POLL_CLI_LIST
+	struct rcu_head		pc_rcu;
+	SPIN_LOCK_T		pc_spinlock;
+#endif
 	struct task_struct	*pc_proc;
 	unsigned int		pc_events;
 	int			pc_wakeup;
@@ -95,12 +99,21 @@
 
 typedef struct {
 	struct list_head	ps_list;
+#ifdef RCU_SSIDEV_POLL_SVR_LIST
+	struct rcu_head		ps_rcu;
+	atomic_t		ps_usecount;
+#else
 	int			ps_usecount;
+#endif
 	struct semaphore	ps_sem;
 	clusternode_t		ps_cnode;
 	caddr_t			ps_cpcp;
 	struct task_struct	*ps_proc;
+#ifdef RCU_SSIDEV_POLL_SVR_LIST
+	unsigned long		ps_state; /* always use atomic bitops on this */
+#else
 	int			ps_wakeup;
+#endif
 	u_int			ps_events;
 	ics_chunk_t		*ps_icp;
 	int			ps_retval;


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.