From: Andrew Morton <akpm@osdl.org>
To: "Stephen C. Tweedie" <sct@redhat.com>
Cc: ext2-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org,
sct@redhat.com
Subject: Re: [RFC] ext3/jbd race: releasing in-use journal_heads
Date: Mon, 7 Mar 2005 12:31:18 -0800 [thread overview]
Message-ID: <20050307123118.3a946bc8.akpm@osdl.org> (raw)
In-Reply-To: <1110213656.15117.193.camel@sisko.sctweedie.blueyonder.co.uk>
"Stephen C. Tweedie" <sct@redhat.com> wrote:
>
> Trouble is, that's not enough; journal_put_journal_head() can nuke the
> buffer with merely the bh_journal_head lock held. In the code above it
> would be enough to take the journal_head_lock over the unfile/file pair.
>
> Andrew, can you remember why we ended up with both of those locks in the
> first place? If we can do it, the efficient way out here is to abandon
> the journal_head_lock and use the bh_state_lock for both. We already
> hold that over many of the key refile spots, and this would avoid the
> need to take yet another lock in those paths.
Oh gosh. It was a transformation from the global journal_datalist_lock and
jh_splice_lock locks. jbd_lock_bh_journal_head() is supposed to be a
finegrained innermost lock whose mandate is purely for atomicity of adding
and removing the journal_head and the b_jcount refcounting. I don't recall
there being any deeper meaning than that.
The original changelog says:
buffer_heads and journal_heads are joined at the hip. We need a lock to
protect the joint and its refcounts.
JBD is currently using a global spinlock for that. Change it to use one bit
in bh->b_state.
It could be that we can optimise jbd_lock_bh_journal_head() away, as you
mention. If we have an assertion in there to check that
jbd_lock_bh_state() is held...
next prev parent reply other threads:[~2005-03-07 21:25 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-04 19:54 Stephen C. Tweedie
2005-03-04 23:17 ` [Ext2-devel] " Badari Pulavarty
2005-03-07 14:28 ` Stephen C. Tweedie
2005-03-05 0:04 ` Andrew Morton
2005-03-07 14:50 ` Jan Kara
2005-03-07 16:01 ` Stephen C. Tweedie
2005-03-07 16:40 ` Stephen C. Tweedie
2005-03-07 17:05 ` Stephen C. Tweedie
2005-03-07 20:31 ` Andrew Morton [this message]
2005-03-07 21:08 ` Stephen C. Tweedie
2005-03-07 21:11 ` Andrew Morton
2005-03-07 21:22 ` Stephen C. Tweedie
2005-03-07 23:13 ` Stephen C. Tweedie
2005-03-07 23:50 ` Andrew Morton
2005-03-08 6:28 ` [Ext2-devel] " Suparna Bhattacharya
2005-03-08 6:39 ` Suparna Bhattacharya
2005-03-08 6:46 ` Andrew Morton
2005-03-08 7:26 ` Suparna Bhattacharya
2005-03-08 7:37 ` Andrew Morton
2005-03-08 8:15 ` Suparna Bhattacharya
2005-03-08 9:28 ` Stephen C. Tweedie
2005-03-08 12:40 ` [PATCH] invalidate/o_direct livelock {was Re: [RFC] ext3/jbd race: releasing in-use journal_heads} Stephen C. Tweedie
2005-03-08 12:53 ` [RFC] ext3/jbd race: releasing in-use journal_heads Stephen C. Tweedie
2005-03-08 15:12 ` Jan Kara
2005-03-09 13:10 ` Stephen C. Tweedie
2005-03-09 13:28 ` Jan Kara
2005-03-09 15:12 ` Stephen C. Tweedie
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=20050307123118.3a946bc8.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=ext2-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=sct@redhat.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
all inboxes | Powered by JetHome®