public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Peter Leckie <pleckie@sgi.com>, xfs@oss.sgi.com, xfs-dev@sgi.com
Subject: Re: [PATCH v2] Use atomic_t and wait_event to track dquot pincount
Date: Sat, 27 Sep 2008 11:18:25 +1000	[thread overview]
Message-ID: <20080927011825.GS27997@disturbed> (raw)
In-Reply-To: <20080926112729.GA3287@infradead.org>

On Fri, Sep 26, 2008 at 07:27:29AM -0400, Christoph Hellwig wrote:
> >  	/*
> > -	 * Cant flush a pinned dquot. Wait for it.
> > +	 * Cant flush a pinned dquot. If we are not supposed to block,
> > +	 * don't wait for it.
> >  	 */
> > +	if (!(flags & XFS_QMOPT_SYNC) && dqp->q_pincount > 0) {
> > +		xfs_dqfunlock(dqp);
> > +		return (0);
> > +	}
> >  	xfs_qm_dqunpin_wait(dqp);
> 
> Looks good, but please remove the braces around the 0.  (And yes, I know
> that the statement just above it does it too..)

No prize for guessing where I copied the code from, then ;)

New version that combines the dirty check with the pin count
check below....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com


XFS: don't block in xfs_qm_dqflush() during async writeback

Normally dquots are written back via delayed write mechanisms.  They
are flushed to their backing buffer by xfssyncd, which is then
pushed out by either AIL or xfsbufd flushing. The flush from the
xfssyncd is supposed to be non-blocking, but xfs_qm_dqflush() always
waits for pinned duots, which means that it will block for the
length of time it takes to do a synchronous log force. This causes
unnecessary extra log I/O to be issued whenever we try to flush a
busy dquot.

Avoid the log forces and blocking xfssyncd by making xfs_qm_dqflush()
pay attention to what type of sync it is doing when it sees a pinned
dquot and not waiting when doing non-blocking flushes.

Signed-off-by: Dave Chinner <david@fromorbit.com>
---
 fs/xfs/quota/xfs_dquot.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/fs/xfs/quota/xfs_dquot.c b/fs/xfs/quota/xfs_dquot.c
index d738d37..aa72162 100644
--- a/fs/xfs/quota/xfs_dquot.c
+++ b/fs/xfs/quota/xfs_dquot.c
@@ -1221,16 +1221,14 @@ xfs_qm_dqflush(
 	xfs_dqtrace_entry(dqp, "DQFLUSH");
 
 	/*
-	 * If not dirty, nada.
+	 * If not dirty, or it's pinned and we are not supposed to
+	 * block, nada.
 	 */
-	if (!XFS_DQ_IS_DIRTY(dqp)) {
+	if (!XFS_DQ_IS_DIRTY(dqp) ||
+	    (!(flags & XFS_QMOPT_SYNC) && dqp->q_pincount > 0)) {
 		xfs_dqfunlock(dqp);
-		return (0);
+		return 0;
 	}
-
-	/*
-	 * Cant flush a pinned dquot. Wait for it.
-	 */
 	xfs_qm_dqunpin_wait(dqp);
 
 	/*

  reply	other threads:[~2008-09-27  1:16 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-24  4:28 [PATCH] Use atomic_t and wait_event to track dquot pincount Peter Leckie
2008-09-24  6:05 ` Dave Chinner
2008-09-24  6:53   ` Peter Leckie
2008-09-24  7:43     ` Dave Chinner
2008-09-24  7:26 ` [PATCH v2] " Peter Leckie
2008-09-24  7:42   ` Lachlan McIlroy
2008-09-24  7:46     ` Dave Chinner
2008-09-24  8:03       ` Lachlan McIlroy
2008-09-24 14:42         ` Christoph Hellwig
2008-09-24  8:15       ` Peter Leckie
2008-09-25  1:03         ` Dave Chinner
2008-09-25  8:43           ` Peter Leckie
2008-09-25  9:12             ` Christoph Hellwig
2008-09-26  0:34             ` Dave Chinner
2008-09-26  1:09               ` Peter Leckie
2008-09-26  1:26                 ` Lachlan McIlroy
2008-09-27  1:08                   ` Dave Chinner
2008-09-26  1:32               ` Lachlan McIlroy
2008-09-26  1:38                 ` Peter Leckie
2008-09-26  1:44                   ` Mark Goodwin
2008-09-26  1:54                     ` Peter Leckie
2008-09-26 11:31                   ` Christoph Hellwig
2008-09-26  2:57                 ` Dave Chinner
2008-09-26  3:38                   ` Lachlan McIlroy
2008-09-27  1:11                     ` Dave Chinner
2008-09-26 11:30                 ` Christoph Hellwig
2008-09-26 11:27               ` Christoph Hellwig
2008-09-27  1:18                 ` Dave Chinner [this message]
2008-09-26  1:10             ` Lachlan McIlroy
2008-09-26 11:28               ` Christoph Hellwig
2008-09-29  3:08                 ` Lachlan McIlroy
2008-09-29 21:45           ` Christoph Hellwig
2008-09-24 14:41       ` Christoph Hellwig
2008-09-25  1:08         ` 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=20080927011825.GS27997@disturbed \
    --to=david@fromorbit.com \
    --cc=hch@infradead.org \
    --cc=pleckie@sgi.com \
    --cc=xfs-dev@sgi.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