All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Subject: [PATCH 1/8] xfs: remove nonblocking mode from xfs_vm_writepage
Date: Wed, 10 Feb 2016 19:47:16 +1100	[thread overview]
Message-ID: <1455094043-9694-2-git-send-email-david@fromorbit.com> (raw)
In-Reply-To: <1455094043-9694-1-git-send-email-david@fromorbit.com>

From: Dave Chinner <dchinner@redhat.com>

Remove the nonblocking optimisation done for mapping lookups during
writeback. It's not clear that leaving a hole in the writeback range
just because we couldn't get a lock is really a win, as it makes us
do another small random IO later on rather than a large sequential
IO now.

As this gets in the way of sane error handling later on, just remove
for the moment and we can re-introduce an equivalent optimisation in
future if we see problems due to extent map lock contention.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_aops.c | 20 +++-----------------
 1 file changed, 3 insertions(+), 17 deletions(-)

diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index 14ac982..00452cb 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -289,8 +289,7 @@ xfs_map_blocks(
 	struct inode		*inode,
 	loff_t			offset,
 	struct xfs_bmbt_irec	*imap,
-	int			type,
-	int			nonblocking)
+	int			type)
 {
 	struct xfs_inode	*ip = XFS_I(inode);
 	struct xfs_mount	*mp = ip->i_mount;
@@ -306,12 +305,7 @@ xfs_map_blocks(
 	if (type == XFS_IO_UNWRITTEN)
 		bmapi_flags |= XFS_BMAPI_IGSTATE;
 
-	if (!xfs_ilock_nowait(ip, XFS_ILOCK_SHARED)) {
-		if (nonblocking)
-			return -EAGAIN;
-		xfs_ilock(ip, XFS_ILOCK_SHARED);
-	}
-
+	xfs_ilock(ip, XFS_ILOCK_SHARED);
 	ASSERT(ip->i_d.di_format != XFS_DINODE_FMT_BTREE ||
 	       (ip->i_df.if_flags & XFS_IFEXTENTS));
 	ASSERT(offset <= mp->m_super->s_maxbytes);
@@ -961,7 +955,6 @@ xfs_vm_writepage(
 	ssize_t			len;
 	int			err, imap_valid = 0, uptodate = 1;
 	int			count = 0;
-	int			nonblocking = 0;
 
 	trace_xfs_writepage(inode, page, 0, 0);
 
@@ -1061,9 +1054,6 @@ xfs_vm_writepage(
 	offset = page_offset(page);
 	type = XFS_IO_OVERWRITE;
 
-	if (wbc->sync_mode == WB_SYNC_NONE)
-		nonblocking = 1;
-
 	do {
 		int new_ioend = 0;
 
@@ -1123,8 +1113,7 @@ xfs_vm_writepage(
 			 * time.
 			 */
 			new_ioend = 1;
-			err = xfs_map_blocks(inode, offset, &imap, type,
-					     nonblocking);
+			err = xfs_map_blocks(inode, offset, &imap, type);
 			if (err)
 				goto error;
 			imap_valid = xfs_imap_valid(inode, &imap, offset);
@@ -1194,9 +1183,6 @@ error:
 	if (iohead)
 		xfs_cancel_ioend(iohead);
 
-	if (err == -EAGAIN)
-		goto redirty;
-
 	xfs_aops_discard_page(page);
 	ClearPageUptodate(page);
 	unlock_page(page);
-- 
2.5.0

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

  reply	other threads:[~2016-02-10  8:48 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-10  8:47 [PATCH 0/8 v4] xfs: get rid of xfs_cluster_write Dave Chinner
2016-02-10  8:47 ` Dave Chinner [this message]
2016-02-10  8:47 ` [PATCH 2/8] xfs: remove xfs_cancel_ioend Dave Chinner
2016-02-10 11:28   ` Christoph Hellwig
2016-02-11  0:21     ` Dave Chinner
2016-02-11 15:14       ` Christoph Hellwig
2016-02-11 20:59         ` Dave Chinner
2016-02-10  8:47 ` [PATCH 3/8] xfs: Introduce writeback context for writepages Dave Chinner
2016-02-10 11:31   ` Christoph Hellwig
2016-02-11  0:25     ` Dave Chinner
2016-02-10  8:47 ` [PATCH 4/8] xfs: xfs_cluster_write is redundant Dave Chinner
2016-02-10  8:47 ` [PATCH 5/8] xfs: factor mapping out of xfs_do_writepage Dave Chinner
2016-02-10  8:47 ` [PATCH 6/8] xfs: don't chain ioends during writepage submission Dave Chinner
2016-02-10 11:36   ` Christoph Hellwig
2016-02-11  0:26     ` Dave Chinner
2016-02-11  6:39     ` Dave Chinner
2016-02-10  8:47 ` [PATCH 7/8] [RFC] xfs: build bios directly in xfs_add_to_ioend Dave Chinner
2016-02-10  8:47 ` [PATCH 8/8] [RFC] xfs: don't release bios on completion immediately Dave Chinner
2016-02-10  9:05 ` [PATCH 0/8 v4] xfs: get rid of xfs_cluster_write Christoph Hellwig
2016-02-10 18:25 ` Christoph Hellwig
2016-02-10 21:25   ` Dave Chinner
2016-02-11 15:13     ` Christoph Hellwig
2016-02-11 20:12       ` 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=1455094043-9694-2-git-send-email-david@fromorbit.com \
    --to=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.