From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 4/4] gfs2: introduce AIL lock
Date: Fri, 05 Feb 2010 11:11:48 +0000 [thread overview]
Message-ID: <1265368308.2524.19.camel@localhost> (raw)
In-Reply-To: <1265348727-19347-5-git-send-email-dchinner@redhat.com>
Hi,
On Fri, 2010-02-05 at 16:45 +1100, Dave Chinner wrote:
> THe log lock is currently used to protect the AIL lists and
> the movements of buffers into and out of them. The lists
> are self contained and no log specific items outside the
> lists are accessed when starting or emptying the AIL lists.
>
> Hence the operation of the AIL does not require the protection
> of the log lock so split them out into a new AIL specific lock
> to reduce the amount of traffic on the log lock. This will
> also reduce the amount of serialisation that occurs when
> the gfs2_logd pushes on the AIL to move it forward.
>
> This reduces the impact of log pushing on sequential write
> throughput. On no-op scheduler on a disk that can do 85MB/s,
> this increases the write rate from 65MB/s with the ordering
> fixes to 75MB/s.
>
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
This looks good, but a couple of comments:
> ---
> fs/gfs2/glops.c | 10 ++++++++--
> fs/gfs2/incore.h | 1 +
> fs/gfs2/log.c | 32 +++++++++++++++++---------------
> fs/gfs2/log.h | 22 ++++++++++++++++++++++
> fs/gfs2/lops.c | 5 ++++-
> fs/gfs2/ops_fstype.c | 1 +
> 6 files changed, 53 insertions(+), 18 deletions(-)
>
> diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
> index 78554ac..65048f9 100644
> --- a/fs/gfs2/glops.c
> +++ b/fs/gfs2/glops.c
> @@ -57,20 +57,26 @@ static void gfs2_ail_empty_gl(struct gfs2_glock *gl)
> BUG_ON(current->journal_info);
> current->journal_info = &tr;
>
> - gfs2_log_lock(sdp);
> + gfs2_ail_lock(sdp);
^^^^ this abstraction of a spinlock is left over from the old
gfs1 code. I'd prefer when adding new locks just to use spinlock(&....)
directly, rather than abstracting it out like this. That way we don't
have to think about what kind of lock it is.
[snip]
> diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c
> index 0fe2f3c..342d65e 100644
> --- a/fs/gfs2/lops.c
> +++ b/fs/gfs2/lops.c
> @@ -80,7 +80,7 @@ static void gfs2_unpin(struct gfs2_sbd *sdp, struct buffer_head *bh,
> mark_buffer_dirty(bh);
> clear_buffer_pinned(bh);
>
> - gfs2_log_lock(sdp);
> + gfs2_ail_lock(sdp);
> if (bd->bd_ail) {
> list_del(&bd->bd_ail_st_list);
> brelse(bh);
> @@ -91,6 +91,9 @@ static void gfs2_unpin(struct gfs2_sbd *sdp, struct buffer_head *bh,
> }
> bd->bd_ail = ai;
> list_add(&bd->bd_ail_st_list, &ai->ai_ail1_list);
> + gfs2_ail_unlock(sdp);
> +
> + gfs2_log_lock(sdp);
> clear_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags);
> trace_gfs2_pin(bd, 0);
> gfs2_log_unlock(sdp);
I don't think the gfs2_log_lock() is actually required at this point.
the LFLUSH bit is protected by the sd_log_flush_lock rwsem
and the tracing doesn't need the log lock either,
Steve.
next prev parent reply other threads:[~2010-02-05 11:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-05 5:45 [Cluster-devel] (no subject) Dave Chinner
2010-02-05 5:45 ` [Cluster-devel] [PATCH 1/4] gfs2: add IO submission trace points Dave Chinner
2010-02-05 9:49 ` Steven Whitehouse
2010-02-05 9:48 ` Christoph Hellwig
2010-02-05 5:45 ` [Cluster-devel] [PATCH 2/4] gfs2: ordered writes are backwards Dave Chinner
2010-02-05 10:02 ` Steven Whitehouse
2010-02-05 10:34 ` Dave Chinner
2010-02-05 5:45 ` [Cluster-devel] [PATCH 3/4] gfs2: ordered buffer writes are not sync Dave Chinner
2010-02-05 10:58 ` Steven Whitehouse
2010-02-05 5:45 ` [Cluster-devel] [PATCH 4/4] gfs2: introduce AIL lock Dave Chinner
2010-02-05 11:11 ` Steven Whitehouse [this message]
2010-02-06 2:34 ` Dave Chinner
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=1265368308.2524.19.camel@localhost \
--to=swhiteho@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 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.