From: bobijam Date: Wed, 4 Feb 2009 01:35:38 +0000 (+0000) Subject: Branch b1_6 X-Git-Tag: GIT_EPOCH_B1_6~2^5~207 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=40893a58b524020ebdaaeb911dce7eb522bd480f;p=fs%2Flustre-release.git Branch b1_6 b=18015 i=johann i=sheng.yang add SLAB_DESTROY_BY_RCU to ldlm_lock_slab's flags for ldlm_locks are freed with RCU mechanism. --- diff --git a/lustre/include/liblustre.h b/lustre/include/liblustre.h index c3f9b53..d946166 100644 --- a/lustre/include/liblustre.h +++ b/lustre/include/liblustre.h @@ -379,6 +379,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, @@ -902,10 +903,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 diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index fd53bb8..aa7e870 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -1135,7 +1135,7 @@ existing_lock: if (dlm_req->lock_desc.l_resource.lr_type == LDLM_EXTENT) lock->l_req_extent = lock->l_policy_data.l_extent; - err = ldlm_lock_enqueue(obddev->obd_namespace, &lock, cookie, + err = ldlm_lock_enqueue(obddev->obd_namespace, &lock, cookie, (int *)&flags); if (err) GOTO(out, err); @@ -1755,7 +1755,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); @@ -1999,8 +1999,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) @@ -2316,8 +2316,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;