From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay3.corp.sgi.com [198.149.34.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id p2PKvioQ245832 for ; Fri, 25 Mar 2011 15:57:44 -0500 Subject: Re: [PATCH 3/6] xfs: introduce inode cluster buffer trylocks for xfs_iflush From: Alex Elder In-Reply-To: <1300860870-15471-4-git-send-email-david@fromorbit.com> References: <1300860870-15471-1-git-send-email-david@fromorbit.com> <1300860870-15471-4-git-send-email-david@fromorbit.com> Date: Fri, 25 Mar 2011 16:00:50 -0500 Message-ID: <1301086850.2537.681.camel@doink> Mime-Version: 1.0 Reply-To: aelder@sgi.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 Wed, 2011-03-23 at 17:14 +1100, Dave Chinner wrote: > From: Dave Chinner > > There is an ABBA deadlock between synchronous inode flushing in > xfs_reclaim_inode and xfs_icluster_free. xfs_icluster_free locks the > buffer, then takes inode ilocks, whilst synchronous reclaim takes > the ilock followed by the buffer lock in xfs_iflush(). > > To avoid this deadlock, separate the inode cluster buffer locking > semantics from the synchronous inode flush semantics, allowing > callers to attempt to lock the buffer but still issue synchronous IO > if it can get the buffer. This requires xfs_iflush() calls that > currently use non-blocking semantics to pass SYNC_TRYLOCK rather > than 0 as the flags parameter. > > This allows xfs_reclaim_inode to avoid the deadlock on the buffer > lock and detect the failure so that it can drop the inode ilock and > restart the reclaim attempt on the inode. This allows > xfs_ifree_cluster to obtain the inode lock, mark the inode stale and > release it and hence defuse the deadlock situation. It also has the > pleasant side effect of avoiding IO in xfs_reclaim_inode when it > tries to next reclaim the inode as it is now marked stale. Looks good. Reviewed-by: Alex Elder > Signed-off-by: Dave Chinner > Reviewed-by: Christoph Hellwig _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs