public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Kill async inode writeback V2
@ 2010-01-05  0:04 Dave Chinner
  2010-01-05  0:04 ` [PATCH 1/3] xfs: Use delayed write for inodes rather than async Dave Chinner
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Dave Chinner @ 2010-01-05  0:04 UTC (permalink / raw)
  To: xfs

Currently we do background inode writeback on demand from many
different places - xfssyncd, xfsbufd, xfsaild and the bdi writeback
threads.  The result is that inodes can be pushed at any time and
there is little to no locality to the IO patterns results from such
writeback. Indeed, we can have completing writebacks occurring which
only serves to slow down writeback.

The idea behind this series is to make metadata buffers get
written from xfsbufd via the delayed write queue rather than than from
all these other places. All the other places do is make the buffers
delayed write so that the xfsbufd can issue them.

This means that inode flushes can no longer happen asynchronously,
but we still need a method for ensuring timely dispatch of buffers
that we may be waiting for IO completion on. To do this, we allow
delayed write buffers to be "promoted" in the delayed write queue.
This effectively short-cuts the aging of the buffers, and combined
with a demand flush of the xfsbufd we push all aged and promoted
buffers out at the same time.

Combine this with sorting the delayed write buffers to be written
into disk offset order before dispatch, and we vastly improve the
IO patterns for metadata writeback. IO is issued from one place and
in a disk/elevator friendly order.

Version 2:
- use generic list sort function
- when unmounting, push the delwri buffers first, then do sync inode
  reclaim so that reclaim doesn't block for 15 seconds waiting for
  delwri inode buffers to be aged and written before the inodes can
  be reclaimed.

Perf results (average of 3 runs) on a debug XFS build (means allocation
patterns are randomly varied, so runtimes are also a bit variable):

Untar 2.6.32 kernel tarball, sync, then remove:

                  Untar+sync     rm -rf
xfs-dev:           25.2s          13.0s
xfs-dev-delwri-1:  22.5s           9.1s
xfs-dev-delwri-2:  21.9s           8.4s

4 processes each creating 100,000, five byte files in separate
directories concurrently, then 4 processes removing a directory each
concurrently.

                  create          rm -rf
xfs-dev:           8m32s           4m10s
xfs-dev-delwri-1:  4m55s           3m42s
xfs-dev-delwri-2:  4m56s           3m33s

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

^ permalink raw reply	[flat|nested] 15+ messages in thread
* [RFC, PATCH 0/3] Kill async inode writeback
@ 2010-01-02  3:03 Dave Chinner
  2010-01-02  3:03 ` [PATCH 1/3] XFS: Use delayed write for inodes rather than async Dave Chinner
  0 siblings, 1 reply; 15+ messages in thread
From: Dave Chinner @ 2010-01-02  3:03 UTC (permalink / raw)
  To: xfs

Currently we do background inode writeback on demand from many
different places - xfssyncd, xfsbufd, the bdi writeback threads and when
pushing the AIL. The result is that inodes can be pushed at any time
and there is little to no locality to the IO patterns results from
such writeback. Indeed, we can have completing writebacks occurring
which only serves to slow down writeback.

The idea behind this series is to make metadata buffers get
written from xfsbufd via the delayed write queue rather than than from
all these other places. All the other places do is make the buffers
delayed write so that the xfsbufd can issue them.

This means that inode flushes can no longer happen asynchronously,
but we still need a method for ensuring timely dispatch of buffers
that we may be waiting for IO completion on. To do this, we allow
delayed write buffers to be "promoted" in the delayed write queue.
This effectively short-cuts the aging of the buffers, and combined
with a demand flush of the xfsbufd we push all aged and promoted
buffers out at the same time.

Combine this with sorting the delayed write buffers to be written
into disk offset order before dispatch, and we vastly improve the
IO patterns for metadata writeback. IO is issued from one place and
in a disk/elevator friendly order.

Perf results on a debug XFS build (means allocation patterns are
variable, so runtimes are also a bit variable):

Untar 2.6.32 kernel tarball, sync, then remove:

		Untar+sync	rm -rf
xfs-dev:	  25.2s          13.0s
xfs-dev-delwri:	  22.5s           9.1s

4 processes each creating 100,000, five byte files in separate
directories concurrently, then 4 processes removing a directory each
concurrently.

		create		rm -rf
xfs-dev:         8m32s           4m10s
xfs-dev-delwri:	 4m55s           3m42s

There is still followup work to be done on the buffer sorting to
make it more efficient, but overall the concept appears to be solid
based on the improvements in sustained small file create rates.

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2010-01-08 11:16 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-05  0:04 [PATCH 0/3] Kill async inode writeback V2 Dave Chinner
2010-01-05  0:04 ` [PATCH 1/3] xfs: Use delayed write for inodes rather than async Dave Chinner
2010-01-08 10:36   ` Christoph Hellwig
2010-01-08 11:05     ` Dave Chinner
2010-01-08 11:14       ` Christoph Hellwig
2010-01-05  0:04 ` [PATCH 2/3] xfs: Don't issue buffer IO direct from AIL push Dave Chinner
2010-01-08 11:07   ` Christoph Hellwig
2010-01-08 11:15     ` Dave Chinner
2010-01-05  0:04 ` [PATCH 3/3] xfs: Sort delayed write buffers before dispatch Dave Chinner
2010-01-08 11:11   ` Christoph Hellwig
2010-01-08 11:17     ` Dave Chinner
2010-01-06 18:08 ` [PATCH 0/3] Kill async inode writeback V2 Christoph Hellwig
2010-01-06 22:49   ` Dave Chinner
2010-01-08 10:14     ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2010-01-02  3:03 [RFC, PATCH 0/3] Kill async inode writeback Dave Chinner
2010-01-02  3:03 ` [PATCH 1/3] XFS: Use delayed write for inodes rather than async Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox