From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id oBTCoLZr064384 for ; Wed, 29 Dec 2010 06:50:24 -0600 Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 925281D0151D for ; Wed, 29 Dec 2010 04:52:25 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id 0sLT2UedMmsc5lY4 for ; Wed, 29 Dec 2010 04:52:25 -0800 (PST) Date: Wed, 29 Dec 2010 07:52:22 -0500 From: Christoph Hellwig Subject: Re: [PATCH 30/34] xfs: convert l_tail_lsn to an atomic variable. Message-ID: <20101229125221.GA1035@infradead.org> References: <1292916570-25015-1-git-send-email-david@fromorbit.com> <1292916570-25015-31-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1292916570-25015-31-git-send-email-david@fromorbit.com> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: xfs-bounces@oss.sgi.com Errors-To: xfs-bounces@oss.sgi.com To: Dave Chinner Cc: xfs@oss.sgi.com On Tue, Dec 21, 2010 at 06:29:26PM +1100, Dave Chinner wrote: > From: Dave Chinner > > 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. > > Signed-off-by: Dave Chinner Looks good, Reviewed-by: Christoph Hellwig > /* log->l_tail_lsn = 0x100000000LL; cycle = 1; current block = 0 */ > - log->l_tail_lsn = xlog_assign_lsn(1, 0); > - atomic64_set(&log->l_last_sync_lsn, xlog_assign_lsn(1, 0)); > + xlog_assign_atomic_lsn(&log->l_tail_lsn, 1, 0); > + xlog_assign_atomic_lsn(&log->l_last_sync_lsn, 1, 0); It might be worth to remove the rather pointless comment above. > BTOBB(XLOG_MAX_ICLOGS << (xfs_sb_version_haslogv2(&log->l_mp->m_sb) ? \ > XLOG_MAX_RECORD_BSHIFT : XLOG_BIG_RECORD_BSHIFT)) > > - > static inline xfs_lsn_t xlog_assign_lsn(uint cycle, uint block) spurious whitespace change _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs