[SSI] openssi/kernel/include/cluster/ssi/cfs cfstok.h,1.17,1.18
Roger Tsang <[email protected]> Fri, 05 Mar 2010 06:07:03 +0000
| Newsgroups | gmane.linux.cluster.ssic.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/cfs
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv3991/include/cluster/ssi/cfs
Modified Files:
Tag: OPENSSI-FC
cfstok.h
Log Message:
CFS (#ifdef RCU_CFSTOK_TABLE):
- Remove sct_statelock spinlock in struct svrcfstok reference counting
code. Use atomic_test_and_add().
- sct_magic is no longer used except for debugging. (#ifdef DEBUG)
- sct_prlist is no longer used in svrcfstok_nodedown since the final
HASH_RELE() releases svrcfstok structure.
cluster/ssi/cfs/svrcfs.c | 98 ++++++++-----------------------
include/cluster/ssi/cfs/cfstok.h | 14 +++-
2 files changed, 38 insertions(+), 74 deletions(-)
Index: cfstok.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/cfs/cfstok.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- cfstok.h 17 Dec 2009 05:45:09 -0000 1.17
+++ cfstok.h 5 Mar 2010 06:07:01 -0000 1.18
@@ -355,8 +355,10 @@
#ifdef RCU_CFSTOK_TABLE
struct hlist_node sct_hlist;
atomic_t sct_refcnt;
- u_long sct_magic;
+#ifdef DEBUG
+ u_long sct_magic; /* protected by sct_statelock */
#define CFSTOK_MAGIC 0xBB55699A
+#endif
#else
struct svrcfstok *sct_next, *sct_prev;
unsigned int sct_refcnt;
@@ -403,7 +405,7 @@
LOCK_T sct_tcblock;
RW_LOCK_T sct_objlock; /* lock for this file or directory */
struct file_ra_state sct_ra;
-#if !defined(CFSTOK_TABLE_LOCK_LOCK) || defined(RCU_CFSTOK_TABLE)
+#if !defined(CFSTOK_TABLE_LOCK_LOCK) && !defined(RCU_CFSTOK_TABLE)
struct list_head sct_prlist;
#endif
#ifdef RCU_CFSTOK_TABLE
@@ -447,7 +449,15 @@
#define HASH_RELE(hp) svrtok_relse(hp)
#ifdef RCU_CFSTOK_TABLE
+#ifdef DEBUG
+#define HASH_HOLD(_hp) do { \
+ BUG_ON((_hp)->sct_magic != CFSTOK_MAGIC); \
+ atomic_inc(&(_hp)->sct_refcnt); \
+} while (0)
+#else
#define HASH_HOLD(_hp) atomic_inc(&(_hp)->sct_refcnt)
+#endif /* !DEBUG */
+
/*
* Macros below are only for remotely held tokens.
* Note: called with sct_tcblock locked.
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev