All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 3/9] xfs: remove the per-filesystem list of dquots
Date: Fri, 17 Feb 2012 12:47:02 -0500	[thread overview]
Message-ID: <20120217174702.GD21796@infradead.org> (raw)
In-Reply-To: <20120215225922.GO14132@dastard>

On Thu, Feb 16, 2012 at 09:59:22AM +1100, Dave Chinner wrote:
> On Tue, Feb 14, 2012 at 09:29:29PM -0500, Christoph Hellwig wrote:
> > Instead of keeping a separate per-filesystem list of dquots we can walk
> > the radix tree for the two places where we need to iterate all quota
> > structures.
> 
> And with the new radix tree iterator code being worked on, this will
> become even simpler soon...

Indeed.

> >  	struct xfs_mount	*mp = dqp->q_mount;
> >  	struct xfs_quotainfo	*qi = mp->m_quotainfo;
> >  
> >  	xfs_dqlock(dqp);
> > +	if ((dqp->dq_flags & XFS_DQ_FREEING) || dqp->q_nrefs != 0) {
> > +		xfs_dqlock(dqp);
> 
> xfs_dqunlock()?

Yes.

> > - * Flush all dquots of the given file system to disk. The dquots are
> > - * _not_ purged from memory here, just their data written to disk.
> > + * The quota lookup is done in batches to keep the amount of lock traffic and
> > + * radix tree lookups to a minimum. The batch size is a trade off between
> > + * lookup reduction and stack usage.
> 
> Given the way the locking works here, the gang lookup doesn't really
> do anythign for reducing lock traffic. It reduces lookup overhead a
> bit, but seeing as we don't drop the tree lock while executing
> operations on each dquot I don't see much advantage in the
> complexity of batched lookups....

True.  On the other hand the code is there and debugged now, so I don't
see much point to change it - except for maybe using the new radix tree
iterator once it goes in.

> The problem I see with this is that it holds the qi_tree_lock over
> the entire walk - it is not dropped anywhere it there is no
> reschedule pressure. Hence all lookups will stall while a walk is in
> progress. Given a walk can block on IO or dquot locks, this could
> mean that a walk holds off lookups for quite some time.

Ok, maybe I should move it to individual lookups.  Then again this
code is only called either after quotacheck, when the isn't online
yet, or during umount/quotaoff, so all this doesn't matter too much.

> Seeing as it is a purge, even on an error I'd still try to purge all
> trees. Indeed, what happens in the case of a filesystem shutdown
> here?

I'll need to take a deeper look and figure this out.  Thanks for the
headsup.

> Hmmmm- all the walk cases pass 0 as their flags. Are they used in
> later patches?

No - it's a copy and paste leftover from the inode iterator.

In fact I'm tempted to simply log all dquots after a quotacheck now
that we have delaylog and support relogging.  After this we could drop
the generic iterator and just hardcode a function that while loop over
finding any dquot and purging it.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2012-02-17 17:47 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
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 [this message]
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=20120217174702.GD21796@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.