[3.0-stable PATCH 14/36] xfs: use shared ilock mode for direct IO writes by default

Dave Chinner david at fromorbit.com
Tue Dec 11 17:43:08 CST 2012


On Mon, Dec 03, 2012 at 05:42:22PM -0600, Mark Tinguely wrote:
> From: Dave Chinner <dchinner at redhat.com>
> 
> Upstream commit: 507630b29f13a3d8689895618b12015308402e22
> 
> For the direct IO write path, we only really need the ilock to be taken in
> exclusive mode during IO submission if we need to do extent allocation
> instead of all the time.
> 
> Change the block mapping code to take the ilock in shared mode for the
> initial block mapping, and only retake it exclusively when we actually
> have to perform extent allocations.  We were already dropping the ilock
> for the transaction allocation, so this doesn't introduce new race windows.
> 

I'm nervous about changing locking like this in -stable kernels.
It's a performance optimisation, not a bug fix, and it wasn't a
problem that xfstests uncovered. Also, xfstests doesn't really
stress the correctness of this code, which is another reason I'm
nervous about it....

Cheers,

Dave.
-- 
Dave Chinner
david at fromorbit.com



More information about the xfs mailing list