xfs
[Top] [All Lists]

Re: [PATCH 1/9] xfs: use per-filesystem dquot LRU lists

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 1/9] xfs: use per-filesystem dquot LRU lists
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Thu, 16 Feb 2012 09:10:45 +1100
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20120215023146.847910539@xxxxxxxxxxxxxxxxxxxxxx>
References: <20120215022926.577682146@xxxxxxxxxxxxxxxxxxxxxx> <20120215023146.847910539@xxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Tue, Feb 14, 2012 at 09:29:27PM -0500, Christoph Hellwig wrote:
> Replace the global dquot lru lists with a per-filesystem one.
> 
> Note that the shrinker isn't wired up to the per-superblock VFS shrinker
> infrastructure, as doing so would cause problems due to summing up and
> splitting out again the counts for inodes and dquots.  I do not believe this
> is a major issue as the quota cache is not deeply interwinded with inode
> and dentry caching.

Yes, that's fine, like the xfs_buf cache has it's own shrinker
and reclaim algorithm....

> Also temporarily stop tracking the system-wide count of dquots on the LRU
> lists for /proc/fs/xfs/xqm, which will be added back later in the series.
> 
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
....
> @@ -869,12 +868,13 @@ recurse:
>  
>       trace_xfs_dqput_free(dqp);
>  
> -     mutex_lock(&xfs_Gqm->qm_dqfrlist_lock);
> -     if (list_empty(&dqp->q_freelist)) {
> -             list_add_tail(&dqp->q_freelist, &xfs_Gqm->qm_dqfrlist);
> -             xfs_Gqm->qm_dqfrlist_cnt++;
> +     mutex_lock(&dqp->q_mount->m_quotainfo->qi_lru_lock);
> +     if (list_empty(&dqp->q_lru)) {
> +             list_add_tail(&dqp->q_lru,
> +                           &dqp->q_mount->m_quotainfo->qi_lru_list);
> +             dqp->q_mount->m_quotainfo->qi_lru_count++;
>       }
> -     mutex_unlock(&xfs_Gqm->qm_dqfrlist_lock);
> +     mutex_unlock(&dqp->q_mount->m_quotainfo->qi_lru_lock);

Might be nice to add a

+       struct xfs_quotainfo    *qi = dqp->q_mount->m_quotainfo;

here  to make the code a little easier to read and consistent with
all the other functions.

Regardless, change looks good.

Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>

-- 
Dave Chinner
david@xxxxxxxxxxxxx

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