All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joel Becker <Joel.Becker@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 06/18] ocfs2_dlm: Link all lockres' to a tracking list
Date: Thu Feb 28 16:32:39 2008	[thread overview]
Message-ID: <20080229003113.GI23975@mail.oracle.com> (raw)
In-Reply-To: <1203970862-8790-7-git-send-email-sunil.mushran@oracle.com>

On Mon, Feb 25, 2008 at 12:20:50PM -0800, Sunil Mushran wrote:
> This patch links all the lockres' to a tracking list in dlm_ctxt.
> We will use this in the upcoming patch that will walk the entire
> list and to dump the lockres states to a debugfs file.
> 
> Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>


> ---
>  fs/ocfs2/dlm/dlmcommon.h |    4 ++++
>  fs/ocfs2/dlm/dlmdomain.c |   11 +++++++++++
>  fs/ocfs2/dlm/dlmmaster.c |   11 +++++++++++
>  3 files changed, 26 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/ocfs2/dlm/dlmcommon.h b/fs/ocfs2/dlm/dlmcommon.h
> index eac1b3b..a3b22bf 100644
> --- a/fs/ocfs2/dlm/dlmcommon.h
> +++ b/fs/ocfs2/dlm/dlmcommon.h
> @@ -101,6 +101,7 @@ struct dlm_ctxt
>  	struct list_head purge_list;
>  	struct list_head pending_asts;
>  	struct list_head pending_basts;
> +	struct list_head tracking_list;
>  	unsigned int purge_count;
>  	spinlock_t spinlock;
>  	spinlock_t ast_lock;
> @@ -266,6 +267,9 @@ struct dlm_lock_resource
>  	struct list_head dirty;
>  	struct list_head recovering; // dlm_recovery_ctxt.resources list
>  
> +	/* Added during init and removed during release */
> +	struct list_head tracking;	/* dlm->tracking_list */
> +
>  	/* unused lock resources have their last_used stamped and are
>  	 * put on a list for the dlm thread to run. */
>  	unsigned long    last_used;
> diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c
> index 6d02ef5..1d382f1 100644
> --- a/fs/ocfs2/dlm/dlmdomain.c
> +++ b/fs/ocfs2/dlm/dlmdomain.c
> @@ -634,6 +634,7 @@ int dlm_shutting_down(struct dlm_ctxt *dlm)
>  void dlm_unregister_domain(struct dlm_ctxt *dlm)
>  {
>  	int leave = 0;
> +	struct dlm_lock_resource *res;
>  
>  	spin_lock(&dlm_domain_lock);
>  	BUG_ON(dlm->dlm_state != DLM_CTXT_JOINED);
> @@ -663,6 +664,15 @@ void dlm_unregister_domain(struct dlm_ctxt *dlm)
>  			msleep(500);
>  			mlog(0, "%s: more migration to do\n", dlm->name);
>  		}
> +
> +		/* This list should be empty. If not, print remaining lockres */
> +		if (!list_empty(&dlm->tracking_list)) {
> +			mlog(ML_ERROR, "Following lockres' are still on the "
> +			     "tracking list:\n");
> +			list_for_each_entry(res, &dlm->tracking_list, tracking)
> +				dlm_print_one_lock_resource(res);
> +		}
> +
>  		dlm_mark_domain_leaving(dlm);
>  		dlm_leave_domain(dlm);
>  		dlm_complete_dlm_shutdown(dlm);
> @@ -1404,6 +1414,7 @@ static struct dlm_ctxt *dlm_alloc_ctxt(const char *domain,
>  	INIT_LIST_HEAD(&dlm->reco.node_data);
>  	INIT_LIST_HEAD(&dlm->purge_list);
>  	INIT_LIST_HEAD(&dlm->dlm_domain_handlers);
> +	INIT_LIST_HEAD(&dlm->tracking_list);
>  	dlm->reco.state = 0;
>  
>  	INIT_LIST_HEAD(&dlm->pending_asts);
> diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
> index d07a30a..d10fe48 100644
> --- a/fs/ocfs2/dlm/dlmmaster.c
> +++ b/fs/ocfs2/dlm/dlmmaster.c
> @@ -642,6 +642,14 @@ static void dlm_lockres_release(struct kref *kref)
>  	mlog(0, "destroying lockres %.*s\n", res->lockname.len,
>  	     res->lockname.name);
>  
> +	if (!list_empty(&res->tracking))
> +		list_del_init(&res->tracking);
> +	else {
> +		mlog(ML_ERROR, "Resource %.*s not on the Tracking list\n",
> +		     res->lockname.len, res->lockname.name);
> +		dlm_print_one_lock_resource(res);
> +	}
> +
>  	if (!hlist_unhashed(&res->hash_node) ||
>  	    !list_empty(&res->granted) ||
>  	    !list_empty(&res->converting) ||
> @@ -709,6 +717,7 @@ static void dlm_init_lockres(struct dlm_ctxt *dlm,
>  	INIT_LIST_HEAD(&res->dirty);
>  	INIT_LIST_HEAD(&res->recovering);
>  	INIT_LIST_HEAD(&res->purge);
> +	INIT_LIST_HEAD(&res->tracking);
>  	atomic_set(&res->asts_reserved, 0);
>  	res->migration_pending = 0;
>  	res->inflight_locks = 0;
> @@ -724,6 +733,8 @@ static void dlm_init_lockres(struct dlm_ctxt *dlm,
>  
>  	res->last_used = 0;
>  
> +	list_add_tail(&res->tracking, &dlm->tracking_list);
> +
>  	memset(res->lvb, 0, DLM_LVB_LEN);
>  	memset(res->refmap, 0, sizeof(res->refmap));
>  }
> -- 
> 1.5.2.5
> 
> 
> _______________________________________________
> Ocfs2-devel mailing list
> Ocfs2-devel@oss.oracle.com
> http://oss.oracle.com/mailman/listinfo/ocfs2-devel

-- 

Life's Little Instruction Book #222

	"Think twice before burdening a friend with a secret."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127

  reply	other threads:[~2008-02-28 16:32 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-25 12:21 [Ocfs2-devel] New dlm debug infrastructure Sunil Mushran
2008-02-25 12:21 ` [Ocfs2-devel] [PATCH 06/18] ocfs2_dlm: Link all lockres' to a tracking list Sunil Mushran
2008-02-28 16:32   ` Joel Becker [this message]
2008-02-25 12:21 ` [Ocfs2-devel] [PATCH 12/18] ocfs2_dlm: Dumps the purgelist into a debugfs file Sunil Mushran
2008-02-28 16:53   ` Joel Becker
2008-02-25 12:21 ` [Ocfs2-devel] [PATCH 10/18] ocfs2_dlm: Moves struct dlm_master_list_entry to dlmcommon.h Sunil Mushran
2008-02-25 12:21 ` [Ocfs2-devel] [PATCH 05/18] ocfs2_dlm: Add missing dlm_lockres_put()s Sunil Mushran
2008-02-28 14:50   ` Joel Becker
2008-02-25 12:21 ` [Ocfs2-devel] [PATCH 15/18] ocfs2_dlm: Move dlm_print_one_mle() from dlmmaster.c to dlmdebug.c Sunil Mushran
2008-02-28 16:55   ` Joel Becker
2008-02-25 12:21 ` [Ocfs2-devel] [PATCH 18/18] ocfs2_dlm: Print message showing the recomaster Sunil Mushran
2008-02-28 16:57   ` Joel Becker
2008-02-25 12:21 ` [Ocfs2-devel] [PATCH 01/18] ocfs2_dlm: Rename slabcache dlm_mle_cache to o2dlm_mle Sunil Mushran
2008-02-28 14:12   ` Joel Becker
2008-02-25 12:21 ` [Ocfs2-devel] [PATCH 02/18] ocfs2_dlm: Creates slabcaches for the lockres' and the locks Sunil Mushran
2008-02-28 14:37   ` Joel Becker
2008-02-28 17:09   ` Joel Becker
2008-02-25 12:21 ` [Ocfs2-devel] [PATCH 04/18] ocfs2_dlm: Add missing dlm_lockres_put()s in migration path Sunil Mushran
2008-02-28 14:41   ` Joel Becker
2008-02-25 12:21 ` [Ocfs2-devel] [PATCH 07/18] ocfs2_dlm: Create debugfs dirs Sunil Mushran
2008-02-28 16:34   ` Joel Becker
2008-02-28 17:09   ` Joel Becker
2008-02-25 12:21 ` [Ocfs2-devel] [PATCH 16/18] ocfs2_dlm: Small fix regarding dlm_print_one_lock_resource() Sunil Mushran
2008-02-28 16:55   ` Joel Becker
2008-02-25 12:21 ` [Ocfs2-devel] [PATCH 17/18] ocfs2_dlm: Fix lockname in lockres print function Sunil Mushran
2008-02-28 16:57   ` Joel Becker
2008-02-25 12:21 ` [Ocfs2-devel] [PATCH 09/18] ocfs2_dlm: Dumps the lockres' into a debugfs file Sunil Mushran
2008-02-28 16:51   ` Joel Becker
2008-02-28 17:11   ` Joel Becker
2008-02-25 12:21 ` [Ocfs2-devel] [PATCH 03/18] ocfs2_dlm: Add missing dlm_lock_put()s Sunil Mushran
2008-02-28 14:39   ` Joel Becker
2008-02-25 12:21 ` [Ocfs2-devel] [PATCH 13/18] ocfs2_dlm: Dumps the workqueue into a debugfs file Sunil Mushran
2008-02-28 16:53   ` Joel Becker
2008-02-28 17:11   ` Joel Becker
2008-02-25 12:21 ` [Ocfs2-devel] [PATCH 14/18] ocfs2_dlm: Remove the proc interface Sunil Mushran
2008-02-28 16:55   ` Joel Becker
2008-02-25 12:21 ` [Ocfs2-devel] [PATCH 11/18] ocfs2_dlm: Dumps the mles into a debugfs file Sunil Mushran
2008-02-28 16:53   ` Joel Becker
2008-02-25 12:21 ` [Ocfs2-devel] [PATCH 08/18] ocfs2_dlm: Dump the dlm state in " Sunil Mushran
2008-02-28 16:38   ` Joel Becker
2008-02-28 17:11   ` Joel Becker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080229003113.GI23975@mail.oracle.com \
    --to=joel.becker@oracle.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.