public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <aelder@sgi.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 08/27] xfs: improve sync behaviour in the fact of aggressive dirtying
Date: Tue, 5 Jul 2011 17:36:18 -0500	[thread overview]
Message-ID: <1309905378.1950.50.camel@doink> (raw)
In-Reply-To: <20110701094603.789209280@bombadil.infradead.org>

On Fri, 2011-07-01 at 05:43 -0400, Christoph Hellwig wrote:
> The following script from Wu Fengguang shows very bad behaviour in XFS
> when aggressively dirtying data during a sync on XFS, with sync times
> up to almost 10 times as long as ext4.

(Note that I skipped over patch 7 for the time being,
trying to skip ahead to simpler changes to review.)

I think the change looks fine but the description doesn't
completely match it (unless I'm missing something).

> A large part of the issue is that XFS writes data out itself two times
> in the ->sync_fs method, overriding the lifelock protection in the core
> writeback code, and another issue is the lock-less xfs_ioend_wait call,
> which doesn't prevent new ioend from beeing queue up while waiting for
> the count to reach zero.

The change affects only the first thing you mention here, not
the second.

Also, if you plan to update the description--some typo's:
- "in the face of" in the subject
- "livelock protection" above
- "beeing" -> "being"


> This patch removes the XFS-internal sync calls and relies on the VFS
> to do it's work just like all other filesystems do.  Note that the
> i_iocount wait which is rather suboptimal is simply removed here.
> We already do it in ->write_inode, which keeps the current supoptimal
> behaviour.  We'll eventually need to remove that as well, but that's
> material for a separate commit.

The i_iocount wait is not affected by your patch.

> ------------------------------ snip ------------------------------
> #!/bin/sh
> 
> umount /dev/sda7
> mkfs.xfs -f /dev/sda7
> # mkfs.ext4 /dev/sda7
> # mkfs.btrfs /dev/sda7
> mount /dev/sda7 /fs
> 
> echo $((50<<20)) > /proc/sys/vm/dirty_bytes
> 
> pid=
> for i in `seq 10`
> do
> 	dd if=/dev/zero of=/fs/zero-$i bs=1M count=1000 &
> 	pid="$pid $!"
> done
> 
> sleep 1
> 
> tic=$(date +'%s')
> sync
> tac=$(date +'%s')
> 
> echo
> echo sync time: $((tac-tic))
> egrep '(Dirty|Writeback|NFS_Unstable)' /proc/meminfo
> 
> pidof dd > /dev/null && { kill -9 $pid; echo sync NOT livelocked; }
> ------------------------------ snip ------------------------------
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Reported-by: Wu Fengguang <fengguang.wu@intel.com>
> Reviewed-by: Dave Chinner <dchinner@redhat.com>

I'm OK with the change, but really prefer to have
the description not include stuff that just isn't
there.  If you want me to commit this as-is, just
say so and I will.  Otherwise, post an update and
I'll use that.  In any case, you can consider this
reviewed by me.

Reviewed-by: Alex Elder <aelder@sgi.com>


> Index: xfs/fs/xfs/linux-2.6/xfs_sync.c
> ===================================================================
> --- xfs.orig/fs/xfs/linux-2.6/xfs_sync.c	2011-06-29 11:26:14.109219361 +0200
> +++ xfs/fs/xfs/linux-2.6/xfs_sync.c	2011-06-29 11:37:20.642275110 +0200
> @@ -359,14 +359,12 @@ xfs_quiesce_data(
>  {
>  	int			error, error2 = 0;
>  
> -	/* push non-blocking */
> -	xfs_sync_data(mp, 0);
>  	xfs_qm_sync(mp, SYNC_TRYLOCK);
> -
> -	/* push and block till complete */
> -	xfs_sync_data(mp, SYNC_WAIT);
>  	xfs_qm_sync(mp, SYNC_WAIT);
>  
> +	/* force out the newly dirtied log buffers */
> +	xfs_log_force(mp, XFS_LOG_SYNC);
> +
>  	/* write superblock and hoover up shutdown errors */
>  	error = xfs_sync_fsdata(mp);
>  
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs



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

  reply	other threads:[~2011-07-05 22:36 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-01  9:43 [PATCH 00/27] patch queue for Linux 3.1, V2 Christoph Hellwig
2011-07-01  9:43 ` [PATCH 01/27] xfs: PF_FSTRANS should never be set in ->writepage Christoph Hellwig
2011-07-01  9:43 ` [PATCH 02/27] xfs: re-enable non-blocking behaviour in xfs_map_blocks Christoph Hellwig
2011-07-05 22:35   ` Alex Elder
2011-07-06  6:37     ` Christoph Hellwig
2011-07-06 13:36       ` Alex Elder
2011-07-01  9:43 ` [PATCH 03/27] xfs: work around bogus gcc warning in xfs_allocbt_init_cursor Christoph Hellwig
2011-07-01  9:43 ` [PATCH 04/27] xfs: split xfs_setattr Christoph Hellwig
2011-07-01  9:43 ` [PATCH 06/27] xfs: kill xfs_itruncate_start Christoph Hellwig
2011-07-01  9:43 ` [PATCH 07/27] xfs: split xfs_itruncate_finish Christoph Hellwig
2011-07-06  4:35   ` Alex Elder
2011-07-06  8:11     ` Christoph Hellwig
2011-07-06 14:05       ` Alex Elder
2011-07-01  9:43 ` [PATCH 08/27] xfs: improve sync behaviour in the fact of aggressive dirtying Christoph Hellwig
2011-07-05 22:36   ` Alex Elder [this message]
2011-07-06  8:15     ` Christoph Hellwig
2011-07-06 14:59       ` Alex Elder
2011-07-01  9:43 ` [PATCH 09/27] xfs: fix filesystsem freeze race in xfs_trans_alloc Christoph Hellwig
2011-07-05 22:36   ` Alex Elder
2011-07-01  9:43 ` [PATCH 10/27] xfs: remove i_transp Christoph Hellwig
2011-07-05 22:36   ` Alex Elder
2011-07-01  9:43 ` [PATCH 11/27] xfs: kill the unused struct xfs_sync_work Christoph Hellwig
2011-07-05 22:36   ` Alex Elder
2011-07-01  9:43 ` [PATCH 12/27] xfs: factor out xfs_dir2_leaf_find_entry Christoph Hellwig
2011-07-05 22:36   ` Alex Elder
2011-07-01  9:43 ` [PATCH 13/27] xfs: cleanup shortform directory inode number handling Christoph Hellwig
2011-07-05 22:36   ` Alex Elder
2011-07-01  9:43 ` [PATCH 14/27] xfs: kill struct xfs_dir2_sf Christoph Hellwig
2011-07-06  1:57   ` Dave Chinner
2011-07-06  8:28     ` Christoph Hellwig
2011-07-06  3:24   ` Alex Elder
2011-07-06  8:33     ` Christoph Hellwig
2011-07-06 15:05       ` Alex Elder
2011-07-01  9:43 ` [PATCH 15/27] xfs: cleanup the defintion of struct xfs_dir2_sf_entry Christoph Hellwig
2011-07-06  2:00   ` Dave Chinner
2011-07-06  3:33   ` Alex Elder
2011-07-06  8:34     ` Christoph Hellwig
2011-07-01  9:43 ` [PATCH 16/27] xfs: avoid usage of struct xfs_dir2_block Christoph Hellwig
2011-07-06  2:19   ` Dave Chinner
2011-07-06  8:35     ` Christoph Hellwig
2011-07-06  3:36   ` Alex Elder
2011-07-01  9:43 ` [PATCH 17/27] xfs: kill " Christoph Hellwig
2011-07-06  2:31   ` Dave Chinner
2011-07-06  8:37     ` Christoph Hellwig
2011-07-06 15:11       ` Alex Elder
2011-07-06  3:36   ` Alex Elder
2011-07-01  9:43 ` [PATCH 18/27] xfs: avoid usage of struct xfs_dir2_data Christoph Hellwig
2011-07-06  3:02   ` Dave Chinner
2011-07-06  8:43     ` Christoph Hellwig
2011-07-06  3:38   ` Alex Elder
2011-07-06  8:45     ` Christoph Hellwig
2011-07-01  9:43 ` [PATCH 19/27] xfs: kill " Christoph Hellwig
2011-07-06  3:05   ` Dave Chinner
2011-07-06  3:38   ` Alex Elder
2011-07-01  9:43 ` [PATCH 20/27] xfs: cleanup the defintion of struct xfs_dir2_data_entry Christoph Hellwig
2011-07-06  3:06   ` Dave Chinner
2011-07-06  3:44   ` Alex Elder
2011-07-06  8:48     ` Christoph Hellwig
2011-07-01  9:43 ` [PATCH 21/27] xfs: cleanup struct xfs_dir2_leaf Christoph Hellwig
2011-07-06  3:13   ` Dave Chinner
2011-07-06  3:44   ` Alex Elder
2011-07-01  9:43 ` [PATCH 22/27] xfs: use generic get_unaligned_beXX helpers Christoph Hellwig
2011-07-06  3:44   ` Dave Chinner
2011-07-06  9:07     ` Christoph Hellwig
2011-07-07  8:00       ` Christoph Hellwig
2011-07-06  3:47   ` Alex Elder
2011-07-01  9:43 ` [PATCH 23/27] xfs: remove the unused xfs_bufhash structure Christoph Hellwig
2011-07-06  3:44   ` Dave Chinner
2011-07-06  3:49   ` Alex Elder
2011-07-01  9:43 ` [PATCH 24/27] xfs: clean up buffer locking helpers Christoph Hellwig
2011-07-06  3:47   ` Dave Chinner
2011-07-06  3:55   ` Alex Elder
2011-07-01  9:43 ` [PATCH 25/27] xfs: return the buffer locked from xfs_buf_get_uncached Christoph Hellwig
2011-07-06  3:48   ` Dave Chinner
2011-07-06  3:57   ` Alex Elder
2011-07-01  9:43 ` [PATCH 26/27] xfs: cleanup I/O-related buffer flags Christoph Hellwig
2011-07-06  3:54   ` Dave Chinner
2011-07-06  9:11     ` Christoph Hellwig
2011-07-06  4:09   ` Alex Elder
2011-07-06  9:11     ` Christoph Hellwig
2011-07-01  9:43 ` [PATCH 27/27] xfs: avoid a few disk cache flushes Christoph Hellwig
2011-07-06  3:55   ` Dave Chinner
2011-07-06  4:11   ` Alex Elder
2011-07-06  4:40 ` [PATCH 00/27] patch queue for Linux 3.1, V2 Alex Elder
2011-07-06  6:42   ` Christoph Hellwig
2011-07-06 13:32     ` Alex Elder
2011-07-06 13:43       ` 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=1309905378.1950.50.camel@doink \
    --to=aelder@sgi.com \
    --cc=hch@infradead.org \
    --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