Whamcloud - gitweb
Branch b1_8
authorbobijam <bobijam>
Wed, 4 Feb 2009 01:42:30 +0000 (01:42 +0000)
committerbobijam <bobijam>
Wed, 4 Feb 2009 01:42:30 +0000 (01:42 +0000)
b=18015
i=joahnn
i=sheng.yang

add SLAB_DESTROY_BY_RCU to ldlm_lock_slab's flags for ldlm_locks are freed
with RCU mechanism.

lustre/include/liblustre.h
lustre/ldlm/ldlm_lockd.c

index cf6cb1a..0f76b89 100644 (file)
@@ -380,6 +380,7 @@ typedef struct {
          int size;
 } kmem_cache_t;
 #define SLAB_HWCACHE_ALIGN 0
+#define SLAB_DESTROY_BY_RCU 0
 static inline kmem_cache_t *
 kmem_cache_create(const char *name, size_t objsize, size_t cdum,
                   unsigned long d,
@@ -903,10 +904,10 @@ void posix_acl_release(struct posix_acl *acl)
 }
 
 #ifdef LIBLUSTRE_POSIX_ACL
- #ifndef posix_acl_xattr_entry 
+ #ifndef posix_acl_xattr_entry
   #define posix_acl_xattr_entry xattr_acl_entry
  #endif
- #ifndef posix_acl_xattr_header 
+ #ifndef posix_acl_xattr_header
   #define posix_acl_xattr_header xattr_acl_header
  #endif
  #ifndef posix_acl_xattr_size
index 2a36093..34079ac 100644 (file)
@@ -285,7 +285,7 @@ static void waiting_locks_callback(unsigned long unused)
                         LDLM_LOCK_GET(lock);
                         spin_unlock_bh(&waiting_locks_spinlock);
                         LDLM_DEBUG(lock, "prolong the busy lock");
-                        ldlm_refresh_waiting_lock(lock, 
+                        ldlm_refresh_waiting_lock(lock,
                                                   ldlm_get_enq_timeout(lock));
                         spin_lock_bh(&waiting_locks_spinlock);
 
@@ -1753,7 +1753,7 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
                 RETURN(0);
         }
 
-        if ((lock->l_flags & LDLM_FL_FAIL_LOC) && 
+        if ((lock->l_flags & LDLM_FL_FAIL_LOC) &&
             lustre_msg_get_opc(req->rq_reqmsg) == LDLM_BL_CALLBACK)
                 OBD_RACE(OBD_FAIL_LDLM_CP_BL_RACE);
 
@@ -1997,8 +1997,8 @@ static int ldlm_bl_thread_main(void *arg)
 
 #endif
 
-/* 
- * Export handle<->lock hash operations. 
+/*
+ * Export handle<->lock hash operations.
  */
 static unsigned
 ldlm_export_lock_hash(lustre_hash_t *lh, void *key, unsigned mask)
@@ -2314,8 +2314,8 @@ int __init ldlm_init(void)
                 return -ENOMEM;
 
         ldlm_lock_slab = cfs_mem_cache_create("ldlm_locks",
-                                           sizeof(struct ldlm_lock), 0,
-                                           SLAB_HWCACHE_ALIGN);
+                                      sizeof(struct ldlm_lock), 0,
+                                      SLAB_HWCACHE_ALIGN | SLAB_DESTROY_BY_RCU);
         if (ldlm_lock_slab == NULL) {
                 cfs_mem_cache_destroy(ldlm_resource_slab);
                 return -ENOMEM;