Whamcloud - gitweb
LU-499 grant/cancel_rate are static when OST is idle
authorLai Siyao <laisiyao@whamcloud.com>
Fri, 5 Aug 2011 03:43:20 +0000 (20:43 -0700)
committerOleg Drokin <green@whamcloud.com>
Thu, 13 Oct 2011 19:21:13 +0000 (15:21 -0400)
ldlm_pool_recalc() shouldn't be skipped if namespace->ns_bref eqauls
zero, instead a flag ns_stopping is added to mark ldlm namespace is
being freed.

Signed-off-by: Lai Siyao <laisiyao@whamcloud.com>
Change-Id: Ic6485c34ec3e9868ae531a4dc25aee969c374eb5
Reviewed-on: http://review.whamcloud.com/1185
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Prakash Surya <surya1@llnl.gov>
Reviewed-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre_dlm.h
lustre/ldlm/ldlm_pool.c
lustre/ldlm/ldlm_resource.c

index 1b04e4c..2620293 100644 (file)
@@ -520,6 +520,8 @@ struct ldlm_namespace {
          * ldlm lock stats
          */
         struct lprocfs_stats  *ns_stats;
+
+        unsigned               ns_stopping:1;   /* namespace cleanup */
 };
 
 static inline int ns_is_client(struct ldlm_namespace *ns)
index 7a88c4d..23e847b 100644 (file)
@@ -1267,9 +1267,9 @@ void ldlm_pools_recalc(ldlm_side_t client)
                 cfs_spin_lock(&ns->ns_lock);
                 /*
                  * skip ns which is being freed, and we don't want to increase
-                 * its refcount again, not even temporarily. bz21519.
+                 * its refcount again, not even temporarily. bz21519 & LU-499.
                  */
-                if (cfs_atomic_read(&ns->ns_bref) == 0) {
+                if (ns->ns_stopping) {
                         skip = 1;
                 } else {
                         skip = 0;
index e11eacf..eb9cb22 100644 (file)
@@ -626,6 +626,7 @@ struct ldlm_namespace *ldlm_namespace_new(struct obd_device *obd, char *name,
         ns->ns_timeouts           = 0;
         ns->ns_orig_connect_flags = 0;
         ns->ns_connect_flags      = 0;
+        ns->ns_stopping           = 0;
         rc = ldlm_namespace_proc_register(ns);
         if (rc != 0) {
                 CERROR("Can't initialize ns proc, rc %d\n", rc);
@@ -839,6 +840,9 @@ void ldlm_namespace_free_prior(struct ldlm_namespace *ns,
                 return;
         }
 
+        cfs_spin_lock(&ns->ns_lock);
+        ns->ns_stopping = 1;
+        cfs_spin_unlock(&ns->ns_lock);
 
         /*
          * Can fail with -EINTR when force == 0 in which case try harder.