diff options
author | Sunil Mushran <sunil.mushran@oracle.com> | 2009-02-26 18:00:43 -0500 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2009-04-03 14:39:21 -0400 |
commit | 2041d8fdcec7603401829f60810c1dbd5e96c043 (patch) | |
tree | b11697962ccdec9556e66e6c261ecff33d1fb468 /fs | |
parent | 67ae1f0604da3bcf3ed6dec59ac71d07e54a404c (diff) |
ocfs2/dlm: Track number of mles
The lifetime of a mle is limited to the duration of the lockres mastery
process. While typically this lifetime is fairly short, we have noticed
the number of mles explode under certain circumstances. This patch tracks
the number of each different types of mles and should help us determine
how best to speed up the mastery process.
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ocfs2/dlm/dlmcommon.h | 5 | ||||
-rw-r--r-- | fs/ocfs2/dlm/dlmdomain.c | 5 | ||||
-rw-r--r-- | fs/ocfs2/dlm/dlmmaster.c | 5 |
3 files changed, 14 insertions, 1 deletions
diff --git a/fs/ocfs2/dlm/dlmcommon.h b/fs/ocfs2/dlm/dlmcommon.h index aa55271a7aca..67b3447a292e 100644 --- a/fs/ocfs2/dlm/dlmcommon.h +++ b/fs/ocfs2/dlm/dlmcommon.h | |||
@@ -52,7 +52,8 @@ | |||
52 | enum dlm_mle_type { | 52 | enum dlm_mle_type { |
53 | DLM_MLE_BLOCK, | 53 | DLM_MLE_BLOCK, |
54 | DLM_MLE_MASTER, | 54 | DLM_MLE_MASTER, |
55 | DLM_MLE_MIGRATION | 55 | DLM_MLE_MIGRATION, |
56 | DLM_MLE_NUM_TYPES | ||
56 | }; | 57 | }; |
57 | 58 | ||
58 | struct dlm_lock_name { | 59 | struct dlm_lock_name { |
@@ -156,6 +157,8 @@ struct dlm_ctxt | |||
156 | struct list_head mle_hb_events; | 157 | struct list_head mle_hb_events; |
157 | 158 | ||
158 | /* these give a really vague idea of the system load */ | 159 | /* these give a really vague idea of the system load */ |
160 | atomic_t mle_tot_count[DLM_MLE_NUM_TYPES]; | ||
161 | atomic_t mle_cur_count[DLM_MLE_NUM_TYPES]; | ||
159 | atomic_t local_resources; | 162 | atomic_t local_resources; |
160 | atomic_t remote_resources; | 163 | atomic_t remote_resources; |
161 | atomic_t unknown_resources; | 164 | atomic_t unknown_resources; |
diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c index 869648c61041..0479bdf91c2b 100644 --- a/fs/ocfs2/dlm/dlmdomain.c +++ b/fs/ocfs2/dlm/dlmdomain.c | |||
@@ -1608,6 +1608,11 @@ static struct dlm_ctxt *dlm_alloc_ctxt(const char *domain, | |||
1608 | atomic_set(&dlm->remote_resources, 0); | 1608 | atomic_set(&dlm->remote_resources, 0); |
1609 | atomic_set(&dlm->unknown_resources, 0); | 1609 | atomic_set(&dlm->unknown_resources, 0); |
1610 | 1610 | ||
1611 | for (i = 0; i < DLM_MLE_NUM_TYPES; ++i) { | ||
1612 | atomic_set(&dlm->mle_tot_count[i], 0); | ||
1613 | atomic_set(&dlm->mle_cur_count[i], 0); | ||
1614 | } | ||
1615 | |||
1611 | spin_lock_init(&dlm->work_lock); | 1616 | spin_lock_init(&dlm->work_lock); |
1612 | INIT_LIST_HEAD(&dlm->work_list); | 1617 | INIT_LIST_HEAD(&dlm->work_list); |
1613 | INIT_WORK(&dlm->dispatched_work, dlm_dispatch_work); | 1618 | INIT_WORK(&dlm->dispatched_work, dlm_dispatch_work); |
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c index 604552ebb468..acfc9288d5cd 100644 --- a/fs/ocfs2/dlm/dlmmaster.c +++ b/fs/ocfs2/dlm/dlmmaster.c | |||
@@ -325,6 +325,9 @@ static void dlm_init_mle(struct dlm_master_list_entry *mle, | |||
325 | mle->u.mlename.hash = dlm_lockid_hash(name, namelen); | 325 | mle->u.mlename.hash = dlm_lockid_hash(name, namelen); |
326 | } | 326 | } |
327 | 327 | ||
328 | atomic_inc(&dlm->mle_tot_count[mle->type]); | ||
329 | atomic_inc(&dlm->mle_cur_count[mle->type]); | ||
330 | |||
328 | /* copy off the node_map and register hb callbacks on our copy */ | 331 | /* copy off the node_map and register hb callbacks on our copy */ |
329 | memcpy(mle->node_map, dlm->domain_map, sizeof(mle->node_map)); | 332 | memcpy(mle->node_map, dlm->domain_map, sizeof(mle->node_map)); |
330 | memcpy(mle->vote_map, dlm->domain_map, sizeof(mle->vote_map)); | 333 | memcpy(mle->vote_map, dlm->domain_map, sizeof(mle->vote_map)); |
@@ -467,6 +470,8 @@ static void dlm_mle_release(struct kref *kref) | |||
467 | /* detach the mle from the domain node up/down events */ | 470 | /* detach the mle from the domain node up/down events */ |
468 | __dlm_mle_detach_hb_events(dlm, mle); | 471 | __dlm_mle_detach_hb_events(dlm, mle); |
469 | 472 | ||
473 | atomic_dec(&dlm->mle_cur_count[mle->type]); | ||
474 | |||
470 | /* NOTE: kfree under spinlock here. | 475 | /* NOTE: kfree under spinlock here. |
471 | * if this is bad, we can move this to a freelist. */ | 476 | * if this is bad, we can move this to a freelist. */ |
472 | kmem_cache_free(dlm_mle_cache, mle); | 477 | kmem_cache_free(dlm_mle_cache, mle); |