Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
LU-499 grant/cancel_rate are static when OST is idle
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
  • Loading branch information
Lai Siyao authored and morrone committed Feb 27, 2012
1 parent 06aba01 commit fd21a6c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lustre/include/lustre_dlm.h
Expand Up @@ -514,6 +514,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)
Expand Down
4 changes: 2 additions & 2 deletions lustre/ldlm/ldlm_pool.c
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions lustre/ldlm/ldlm_resource.c
Expand Up @@ -619,6 +619,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);
Expand Down Expand Up @@ -832,6 +833,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.
Expand Down

0 comments on commit fd21a6c

Please sign in to comment.