public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
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 2/7] xfs: Use delayed write for inodes rather than async
Date: Tue, 26 Jan 2010 11:10:45 -0500	[thread overview]
Message-ID: <20100126161045.GB24152@infradead.org> (raw)
In-Reply-To: <20100125223140.GN25842@discord.disaster>

> > Also in this context
> > the requeue label name doesn't fit too well, even if it's the same
> > action as the requeue.
> 
> I'm open to suggestions for a better name ;)

What do you think about this version?

Index: xfs/fs/xfs/linux-2.6/xfs_sync.c
===================================================================
--- xfs.orig/fs/xfs/linux-2.6/xfs_sync.c	2010-01-26 17:01:49.610012226 +0100
+++ xfs/fs/xfs/linux-2.6/xfs_sync.c	2010-01-26 17:06:50.533006103 +0100
@@ -785,7 +785,7 @@ xfs_reclaim_inode(
 	xfs_ilock(ip, XFS_ILOCK_EXCL);
 	if (!xfs_iflock_nowait(ip)) {
 		if (!(sync_mode & SYNC_WAIT))
-			goto requeue_no_flock;
+			goto out;
 		xfs_iflock(ip);
 	}
 
@@ -796,8 +796,10 @@ xfs_reclaim_inode(
 		goto reclaim;
 	}
 	if (xfs_ipincount(ip)) {
-		if (!(sync_mode & SYNC_WAIT))
-			goto requeue;
+		if (!(sync_mode & SYNC_WAIT)) {
+			xfs_ifunlock(ip);
+			goto out;
+		}
 		xfs_iunpin_wait(ip);
 	}
 	if (xfs_iflags_test(ip, XFS_ISTALE))
@@ -807,19 +809,18 @@ xfs_reclaim_inode(
 
 	/* Now we have an inode that needs flushing */
 	error = xfs_iflush(ip, sync_mode);
-	if (!(sync_mode & SYNC_WAIT))
-		goto requeue_no_flock;
-	xfs_iflock(ip);
-
-reclaim:
-	xfs_ifunlock(ip);
-	xfs_iunlock(ip, XFS_ILOCK_EXCL);
-	xfs_ireclaim(ip);
-	return error;
+	if (sync_mode & SYNC_WAIT) {
+		xfs_iflock(ip);
+		goto reclaim;
+	}
 
-requeue:
-	xfs_ifunlock(ip);
-requeue_no_flock:
+	/*
+	 * When we have to flush an inode but don't have SYNC_WAIT set, we
+	 * flush the inode out with using a delwri buffer and wait for
+	 * the next call into the reclaim to find it in a clean state
+	 * instead of doing it now.
+	 */
+out:
 	xfs_iflags_clear(ip, XFS_IRECLAIM);
 	xfs_iunlock(ip, XFS_ILOCK_EXCL);
 	/*
@@ -830,6 +831,12 @@ requeue_no_flock:
 	 * attempt to reclaim the inode again.
 	 */
 	return 0;
+
+reclaim:
+	xfs_ifunlock(ip);
+	xfs_iunlock(ip, XFS_ILOCK_EXCL);
+	xfs_ireclaim(ip);
+	return error;
 }
 
 int

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

  parent reply	other threads:[~2010-01-26 16:09 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-25  6:22 [PATCH 0/7] Delayed write metadata writeback V3 Dave Chinner
2010-01-25  6:22 ` [PATCH 1/7] xfs: Make inode reclaim states explicit Dave Chinner
2010-01-25 11:47   ` Christoph Hellwig
2010-01-25  6:22 ` [PATCH 2/7] xfs: Use delayed write for inodes rather than async Dave Chinner
2010-01-25 11:53   ` Christoph Hellwig
2010-01-25 22:31     ` Dave Chinner
2010-01-26  7:28       ` Dave Chinner
2010-01-26 16:10       ` Christoph Hellwig [this message]
2010-02-01 22:59         ` Dave Chinner
2010-01-25 15:29   ` Christoph Hellwig
2010-01-25  6:22 ` [PATCH 3/7] xfs: Don't issue buffer IO direct from AIL push Dave Chinner
2010-01-25 11:59   ` Christoph Hellwig
2010-01-25  6:22 ` [PATCH 4/7] xfs: Sort delayed write buffers before dispatch Dave Chinner
2010-01-25 12:00   ` Christoph Hellwig
2010-01-26  4:13     ` Dave Chinner
2010-01-25  6:22 ` [PATCH 5/7] xfs: Use delay write promotion for dquot flushing Dave Chinner
2010-01-25 12:03   ` Christoph Hellwig
2010-01-25  6:22 ` [PATCH 6/7] xfs: kill the unused XFS_QMOPT_* flush flags Dave Chinner
2010-01-25 12:04   ` Christoph Hellwig
2010-01-25  6:22 ` [PATCH 7/7] xfs: xfs_fs_write_inode() can fail to write inodes synchronously Dave Chinner
2010-01-25 16:03   ` Christoph Hellwig
2010-01-26  4:51     ` 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=20100126161045.GB24152@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