From: Joel Becker <Joel.Becker@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 1/2] ocfs2 fix o2dlm dlm run purgelist
Date: Thu, 17 Jun 2010 02:08:58 -0700 [thread overview]
Message-ID: <20100617090858.GB17748@mail.oracle.com> (raw)
In-Reply-To: <4C19DDBB.7060704@oracle.com>
On Thu, Jun 17, 2010 at 01:32:59AM -0700, Srinivas Eeda wrote:
> On 6/16/2010 6:39 PM, Joel Becker wrote:
> As of today, we always get the lockres from the head of the
> dlm->purge_list. If it is in use, we keep trying. If that gets
> purged, we move to next res which again would be on the head of the
> dlm->purge_list. But with my change that won't be the case. If first
> (few) lockres are in use, we will try the one we could purge. So we
> should get the next lockres before list_del_init(&res->purge)
> happens and hence I moved the code. If you didn't like the delete
> code in dlm_run_purge_list, then we have to make dlm_purge_lockres
> to return the next lockres that should get purged.
Or it does everything but the delete, and then you have
run_purge_list do the delete right after returning when the return code
is zero. My problem wasn't that you moved the delete, it was that you
moved all the other checks and things.
> If you are suggesting that we move the lockres to the tail if we
> found it in use, then the code will be lot more readable. The
> current code doesn't move the unused lockres to tail, so wanted to
> preserve that logic as I am not sure what was the original intent.
> If move used lockres to tail, would you suggest we also update
> lockres->last_used?
Like I responded to Sunil, it sure looks like the code wants the
same order. If moving to the end is safe, that's obviously the best
answer.
> what would list_entry return, if the lockres was the last on the
> list. I was thinking it would return something random ..
It returns the head of the list. These are doubly-linked lists.
list_empty() actually checks whether head->next == head. You can just
have the while loop say "while (lockres->list != head)" to exit at the last
item. Then when you say 'lockres = list_entry(lockres->next);
continue;", the while loop exits properly at the end of the list.
Joel
--
Life's Little Instruction Book #198
"Feed a stranger's expired parking meter."
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
next prev parent reply other threads:[~2010-06-17 9:08 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-16 4:43 [Ocfs2-devel] [PATCH 1/2] ocfs2 fix o2dlm dlm run purgelist Srinivas Eeda
2010-06-16 4:43 ` [Ocfs2-devel] [PATCH 2/2] ocfs2: o2dlm fix race in purge lockres and newlock (orabug 9094491) Srinivas Eeda
2010-06-18 2:11 ` Sunil Mushran
2010-06-18 16:32 ` Srinivas Eeda
2010-06-16 6:06 ` [Ocfs2-devel] [PATCH 1/2] ocfs2 fix o2dlm dlm run purgelist Wengang Wang
2010-06-17 8:53 ` Srinivas Eeda
2010-06-17 11:05 ` Wengang Wang
2010-06-17 15:06 ` Sunil Mushran
2010-06-17 16:56 ` Srinivas Eeda
2010-06-18 2:37 ` Wengang Wang
2010-06-18 16:37 ` Sunil Mushran
2010-06-21 1:40 ` Wengang Wang
2010-06-17 1:39 ` Joel Becker
2010-06-17 8:32 ` Srinivas Eeda
2010-06-17 9:08 ` Joel Becker [this message]
2010-06-17 1:44 ` Sunil Mushran
2010-06-17 6:05 ` Wengang Wang
2010-06-17 8:32 ` Joel Becker
2010-06-17 8:35 ` Srinivas Eeda
2010-06-17 14:48 ` Sunil Mushran
2010-06-17 16:55 ` Srinivas Eeda
2010-06-17 19:31 ` Sunil Mushran
2010-06-17 19:28 ` Joel Becker
2010-06-17 23:34 ` Sunil Mushran
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=20100617090858.GB17748@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).