From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 08/12] xfs: convert l_tail_lsn to an atomic variable.
Date: Tue, 21 Dec 2010 12:27:17 +1100 [thread overview]
Message-ID: <20101221012717.GP5193@dastard> (raw)
In-Reply-To: <20101220120634.GA3582@infradead.org>
On Mon, Dec 20, 2010 at 07:06:34AM -0500, Christoph Hellwig wrote:
> On Mon, Dec 13, 2010 at 03:44:39PM +1100, Dave Chinner wrote:
> > From: Dave Chinner <dchinner@redhat.com>
> >
> > log->l_tail_lsn is currently protected by the log grant lock. The
> > lock is only needed for serialising readers against writers, so we
> > don't really need the lock if we make the l_tail_lsn variable an
> > atomic. Converting the l_tail_lsn variable to an atomic64_t means we
> > can start to peel back the grant lock from various operations.
> >
> > Also, provide functions to safely crack an atomic LSN variable into
> > it's component pieces and to recombined the components into an
> > atomic variable. Use them where appropriate.
> >
> > This also removes the need for explicitly holding a spinlock to read
> > the l_tail_lsn on 32 bit platforms.
>
> I know I suggested this, but I think the atomic read of l_tail_lsn
> in xlog_space_left might be problemetic for the call from
> xlog_grant_push_ail, where we read it twice now. Maybe split
> xlog_space_left into a __xlog_space_left that gets the already cracked
> values, and xlog_space_left as a wrapper around it?
I'd convinced myself that it wouldn't be a problem. That is,
once we have a value for the tail_lsn in xlog_grant_push_ail(), the
threshold that we will push to is effectively fixed. The only thing
that will change is the amount of log space currently available,
which can only increase if the tail moves.
Hence we'll either get:
a) not enough log space and have to push, in which case the
value of the tail lsn seen in xlog_space_left() is
irrelevant to the threshold lsn we calculate, or
b) we'll have enough log space and not need to push in which
case we don't need to use the tail_lsn at all because we
don't need to push.
So it seems to me that the double sample of the tail_lsn doesn't
matter at all for this code. Is there a hole in my logic here?
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2010-12-21 1:25 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-13 4:44 xfs: grant lock scaling and removal V3 Dave Chinner
2010-12-13 4:44 ` [PATCH 01/12] xfs: convert log grant ticket queues to list heads Dave Chinner
2010-12-20 11:34 ` Christoph Hellwig
2010-12-21 0:55 ` Dave Chinner
2010-12-13 4:44 ` [PATCH 02/12] xfs: fact out common grant head/log tail verification code Dave Chinner
2010-12-20 11:51 ` Christoph Hellwig
2010-12-13 4:44 ` [PATCH 03/12] xfs: rework log grant space calculations Dave Chinner
2010-12-20 11:37 ` Christoph Hellwig
2010-12-13 4:44 ` [PATCH 04/12] xfs: combine grant heads into a single 64 bit integer Dave Chinner
2010-12-20 11:40 ` Christoph Hellwig
2010-12-13 4:44 ` [PATCH 05/12] xfs: use wait queues directly for the log wait queues Dave Chinner
2010-12-20 11:40 ` Christoph Hellwig
2010-12-13 4:44 ` [PATCH 06/12] xfs: make AIL tail pushing independent of the grant lock Dave Chinner
2010-12-20 11:41 ` Christoph Hellwig
2010-12-13 4:44 ` [PATCH 07/12] xfs: convert l_last_sync_lsn to an atomic variable Dave Chinner
2010-12-13 4:44 ` [PATCH 08/12] xfs: convert l_tail_lsn " Dave Chinner
2010-12-20 12:06 ` Christoph Hellwig
2010-12-21 1:27 ` Dave Chinner [this message]
2010-12-13 4:44 ` [PATCH 09/12] xfs: convert log grant heads to atomic variables Dave Chinner
2010-12-13 4:44 ` [PATCH 10/12] xfs: introduce new locks for the log grant ticket wait queues Dave Chinner
2010-12-20 11:49 ` Christoph Hellwig
2010-12-13 4:44 ` [PATCH 11/12] xfs: convert grant head manipulations to lockless algorithm Dave Chinner
2010-12-20 11:50 ` Christoph Hellwig
2010-12-13 4:44 ` [PATCH 12/12] xfs: kill useless spinlock_destroy macro 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=20101221012717.GP5193@dastard \
--to=david@fromorbit.com \
--cc=hch@infradead.org \
--cc=xfs@oss.sgi.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