From: Christoph Hellwig <hch@infradead.org>
To: Dave Chinner <david@fromorbit.com>
Cc: Christoph Hellwig <hch@infradead.org>, xfs@oss.sgi.com
Subject: Re: [PATCH 4/3] xfs: xfs_qm_dqrele mostly doesn't need locking
Date: Mon, 16 Dec 2013 10:21:52 -0800 [thread overview]
Message-ID: <20131216182152.GA22721@infradead.org> (raw)
In-Reply-To: <20131213213006.GU10988@dastard>
On Sat, Dec 14, 2013 at 08:30:06AM +1100, Dave Chinner wrote:
> > if (atomic_dec_and_test(&dqp->q_nrefs)) {
> > if (list_lru_add(&mp->m_quotainfo->qi_lru, &dqp->q_lru))
> > XFS_STATS_INC(xs_qm_dquot_unused);
> > }
> >
> > given that the only locking we need is the internal lru lock?
>
> Yes, I think it is.
>
> However, that involves changing all the callers of dqput to not hold
> the dqlock when they call, which is a bigger change than was
> necessary to avoid the lock contention problem. i.e. it doesn't seem
> to be in a fast path that needed immediate fixing, so I didn't touch
> it.
Given that the lru list lock nests inside dqlock we can just turn
dqput into:
void
xfs_qm_dqput(
struct xfs_dquot *dqp)
{
ASSERT(dqp->q_nrefs > 0);
ASSERT(XFS_DQ_IS_LOCKED(dqp));
trace_xfs_dqput(dqp);
xfs_qm_dqrele(dqp);
xfs_dqunlock(dqp);
}
But with my other patch we can probably replace most callers
with xfs_qm_dqrele, and the remaining ones with an opencoded
version that first drops the lock easily.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2013-12-16 18:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-12 9:40 [PATCH 0/3] xfs: dquot modification scalability Dave Chinner
2013-12-12 9:40 ` [PATCH 1/3] xfs: remote dquot hints Dave Chinner
2013-12-12 18:33 ` Christoph Hellwig
2013-12-12 9:40 ` [PATCH 2/3] xfs: dquot refcounting by atomics Dave Chinner
2013-12-13 13:23 ` Christoph Hellwig
2013-12-12 9:40 ` [PATCH 3/3] xfs: xfs_trans_dqresv() can be made lockless Dave Chinner
2013-12-13 13:37 ` Christoph Hellwig
2013-12-16 0:11 ` Dave Chinner
2013-12-12 10:25 ` [PATCH 4/3] xfs: xfs_qm_dqrele mostly doesn't need locking Dave Chinner
2013-12-13 13:28 ` Christoph Hellwig
2013-12-13 21:30 ` Dave Chinner
2013-12-16 18:21 ` Christoph Hellwig [this message]
2013-12-13 16:30 ` [PATCH 5/3] xfs: return unlocked dquots from xfs_qm_dqqet Christoph Hellwig
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=20131216182152.GA22721@infradead.org \
--to=hch@infradead.org \
--cc=david@fromorbit.com \
--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