From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 2/9] xfs: use per-filesystem radix trees for dquot lookup
Date: Thu, 16 Feb 2012 09:21:11 +1100 [thread overview]
Message-ID: <20120215222111.GN14132@dastard> (raw)
In-Reply-To: <20120215023147.038502020@bombadil.infradead.org>
On Tue, Feb 14, 2012 at 09:29:28PM -0500, Christoph Hellwig wrote:
> Replace the global hash tables for looking up in-memory dquot structures
> with per-filesystem radix trees to allow scaling to a large number of
> in-memory dquot structures.
And simplifies the code a lot. Only minor comments about using
local quotainfo variables below.
> @@ -1593,10 +1515,10 @@ xfs_qm_dqfree_one(
> struct xfs_mount *mp = dqp->q_mount;
> struct xfs_quotainfo *qi = mp->m_quotainfo;
>
> - mutex_lock(&dqp->q_hash->qh_lock);
> - list_del_init(&dqp->q_hashlist);
> - dqp->q_hash->qh_version++;
> - mutex_unlock(&dqp->q_hash->qh_lock);
> + mutex_lock(&mp->m_quotainfo->qi_tree_lock);
> + radix_tree_delete(XFS_DQUOT_TREE(mp, dqp->q_core.d_flags),
> + be32_to_cpu(dqp->q_core.d_id));
> + mutex_unlock(&mp->m_quotainfo->qi_tree_lock);
qi->qi_tree_lock, as the local variable is already set up.
> @@ -672,10 +618,9 @@ xfs_qm_dqget(
> uint flags, /* DQALLOC, DQSUSER, DQREPAIR, DOWARN */
> xfs_dquot_t **O_dqpp) /* OUT : locked incore dquot */
> {
> - xfs_dquot_t *dqp, *dqp1;
> - xfs_dqhash_t *h;
> - uint version;
> - int error;
> + struct radix_tree_root *tree = XFS_DQUOT_TREE(mp, type);
> + struct xfs_dquot *dqp;
> + int error;
Add a quotainfo local variable and use it in the function?
> @@ -1171,10 +1078,10 @@ xfs_qm_dqpurge(
> xfs_dqfunlock(dqp);
> xfs_dqunlock(dqp);
>
> - mutex_lock(&qh->qh_lock);
> - list_del_init(&dqp->q_hashlist);
> - qh->qh_version++;
> - mutex_unlock(&qh->qh_lock);
> + mutex_lock(&mp->m_quotainfo->qi_tree_lock);
> + radix_tree_delete(XFS_DQUOT_TREE(mp, dqp->q_core.d_flags),
> + be32_to_cpu(dqp->q_core.d_id));
> + mutex_unlock(&mp->m_quotainfo->qi_tree_lock);
qi->qi_tree_lock as it is already there and used for all the other
quotainfo references.
Otherwise looks good.
Reviewed-by: Dave Chinner <dchinner@redhat.com>
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2012-02-15 22:21 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-15 2:29 [PATCH 0/9] quota updates V2 Christoph Hellwig
2012-02-15 2:29 ` [PATCH 1/9] xfs: use per-filesystem dquot LRU lists Christoph Hellwig
2012-02-15 22:10 ` Dave Chinner
2012-02-17 17:33 ` Christoph Hellwig
2012-02-15 2:29 ` [PATCH 2/9] xfs: use per-filesystem radix trees for dquot lookup Christoph Hellwig
2012-02-15 22:21 ` Dave Chinner [this message]
2012-02-17 17:38 ` Christoph Hellwig
2012-02-15 2:29 ` [PATCH 3/9] xfs: remove the per-filesystem list of dquots Christoph Hellwig
2012-02-15 22:59 ` Dave Chinner
2012-02-17 17:47 ` Christoph Hellwig
2012-02-15 2:29 ` [PATCH 4/9] xfs: use per-CPU data for the quota statistics Christoph Hellwig
2012-02-15 23:59 ` Dave Chinner
2012-02-17 17:48 ` Christoph Hellwig
2012-02-15 2:29 ` [PATCH 5/9] xfs: user per-cpu stats for the total dquot numbers Christoph Hellwig
2012-02-16 0:02 ` Dave Chinner
2012-02-17 17:48 ` Christoph Hellwig
2012-02-15 2:29 ` [PATCH 6/9] xfs: remove the global xfs_Gqm structure Christoph Hellwig
2012-02-16 0:07 ` Dave Chinner
2012-02-15 2:29 ` [PATCH 7/9] xfs: merge xfs_qm_export_dquot into xfs_qm_scall_getquota Christoph Hellwig
2012-02-16 0:11 ` Dave Chinner
2012-02-27 1:57 ` Ben Myers
2012-02-15 2:29 ` [PATCH 8/9] xfs: include reservations in quota reporting Christoph Hellwig
2012-02-16 0:14 ` Dave Chinner
2012-02-15 2:29 ` [PATCH 9/9] quota: make Q_XQUOTASYNC a noop Christoph Hellwig
2012-02-16 0:15 ` Dave Chinner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120215222111.GN14132@dastard \
--to=david@fromorbit.com \
--cc=hch@infradead.org \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox