From b5870e11384cb45fb6a7d8dfb7dc856ab4f751d6 Mon Sep 17 00:00:00 2001 From: bobijam Date: Wed, 4 Feb 2009 01:45:47 +0000 Subject: [PATCH] Branch HEAD 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. --- libcfs/include/libcfs/user-mem.h | 1 + lustre/ldlm/ldlm_lockd.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libcfs/include/libcfs/user-mem.h b/libcfs/include/libcfs/user-mem.h index 701d8f8..ab501b8 100644 --- a/libcfs/include/libcfs/user-mem.h +++ b/libcfs/include/libcfs/user-mem.h @@ -78,6 +78,7 @@ typedef struct { } cfs_mem_cache_t; #define SLAB_HWCACHE_ALIGN 0 +#define SLAB_DESTROY_BY_RCU 0 #define SLAB_KERNEL 0 #define SLAB_NOFS 0 diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index b56a42c..58875a9 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -2435,8 +2435,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; -- 1.8.3.1