xfs
[Top] [All Lists]

Re: [PATCH 08/12] xfs: convert l_tail_lsn to an atomic variable.

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 08/12] xfs: convert l_tail_lsn to an atomic variable.
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 20 Dec 2010 07:06:34 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1292215483-18224-9-git-send-email-david@xxxxxxxxxxxxx>
References: <1292215483-18224-1-git-send-email-david@xxxxxxxxxxxxx> <1292215483-18224-9-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Dec 13, 2010 at 03:44:39PM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
> 
> 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?

<Prev in Thread] Current Thread [Next in Thread>