xfs
[Top] [All Lists]

Re: [PATCH] xfs: reduce lock traffic on incore sb lock

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH] xfs: reduce lock traffic on incore sb lock
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Wed, 29 Sep 2010 00:04:25 -0400
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1285721500-5671-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1285721500-5671-1-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.20 (2009-08-17)
On Wed, Sep 29, 2010 at 10:51:40AM +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
> 
> Under heavy parallel unlink workloads, the incore superblock lock is
> heavily trafficed in xfs_mod_incore_sb_batch(). This is despite the
> fact that the counters being modified are typically the counters
> that are per-cpu and do not require the lock. IOWs, we are locking
> and unlocking the superblock lock needlessly, and the result is that
> it is third most heavily contended lock in the system under these
> workloads.
> 
> Fix this by only locking the superblock lock when we are modifying a
> counter protected by it. This completely removes the m_sb_lock from
> lock_stat traces during create/remove workloads.

God spot of the idiocy there, but I really don't like the patch.
I've started writing a small patches series solving the issue slightly
better by cleaning up this area a bit.

After this we will never use xfs_mod_incore_sb/xfs_mod_incore_sb_batch
for the percpu counters but rather make those always go through
xfs_icsb_modify_counters.  I'll need to quickly finish it up and will
send it out soon.

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