linux-stable/drivers/md
Kazuo Ito b673c3a819 dm kcopyd: avoid queue shuffle
Write throughput to LVM snapshot origin volume is an order
of magnitude slower than those to LV without snapshots or
snapshot target volumes, especially in the case of sequential
writes with O_SYNC on.

The following patch originally written by Kevin Jamieson and
Jan Blunck and slightly modified for the current RCs by myself
tries to improve the performance by modifying the behaviour
of kcopyd, so that it pushes back an I/O job to the head of
the job queue instead of the tail as process_jobs() currently
does when it has to wait for free pages. This way, write
requests aren't shuffled to cause extra seeks.

I tested the patch against 2.6.27-rc5 and got the following results.
The test is a dd command writing to snapshot origin followed by fsync
to the file just created/updated.  A couple of filesystem benchmarks
gave me similar results in case of sequential writes, while random
writes didn't suffer much.

dd if=/dev/zero of=<somewhere on snapshot origin> bs=4096 count=...
   [conv=notrunc when updating]

1) linux 2.6.27-rc5 without the patch, write to snapshot origin,
average throughput (MB/s)
                     10M     100M    1000M
create,dd         511.46   610.72    11.81
create,dd+fsync     7.10     6.77     8.13
update,dd         431.63   917.41    12.75
update,dd+fsync     7.79     7.43     8.12

compared with write throughput to LV without any snapshots,
all dd+fsync and 1000 MiB writes perform very poorly.

                     10M     100M    1000M
create,dd         555.03   608.98   123.29
create,dd+fsync   114.27    72.78    76.65
update,dd         152.34  1267.27   124.04
update,dd+fsync   130.56    77.81    77.84

2) linux 2.6.27-rc5 with the patch, write to snapshot origin,
average throughput (MB/s)

                     10M     100M    1000M
create,dd         537.06   589.44    46.21
create,dd+fsync    31.63    29.19    29.23
update,dd         487.59   897.65    37.76
update,dd+fsync    34.12    30.07    26.85

Although still not on par with plain LV performance -
cannot be avoided because it's copy on write anyway -
this simple patch successfully improves throughtput
of dd+fsync while not affecting the rest.

Signed-off-by: Jan Blunck <jblunck@suse.de>
Signed-off-by: Kazuo Ito <ito.kazuo@oss.ntt.co.jp>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Cc: stable@kernel.org
2008-10-21 17:44:50 +01:00
..
raid6test md: raid6: clean up the style of raid6test/test.c 2008-02-06 10:41:18 -08:00
.gitignore
bitmap.c Fix problem with waiting while holding rcu read lock in md/bitmap.c 2008-09-01 12:48:13 +10:00
dm-bio-list.h dm: bio_list macro renaming 2007-10-20 02:01:11 +01:00
dm-bio-record.h
dm-crypt.c dm crypt: avoid unnecessary wait when splitting bio 2008-10-10 13:37:08 +01:00
dm-delay.c dm: bio_list macro renaming 2007-10-20 02:01:11 +01:00
dm-exception-store.c dm exception store: use chunk_t for_areas 2008-10-10 13:37:01 +01:00
dm-io.c dm: unplug queues in threads 2008-04-25 13:26:57 +01:00
dm-ioctl.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm 2008-10-10 11:11:47 -07:00
dm-kcopyd.c dm kcopyd: avoid queue shuffle 2008-10-21 17:44:50 +01:00
dm-linear.c dm: linear add merge 2008-07-21 12:00:38 +01:00
dm-log.c dm log: make dm_dirty_log init and exit static 2008-07-21 12:00:27 +01:00
dm-mpath.c [SCSI] block: separate failfast into multiple bits. 2008-10-13 09:28:52 -04:00
dm-mpath.h dm mpath: remove is_active from struct dm_path 2008-10-10 13:36:58 +01:00
dm-path-selector.c dm: use kzalloc 2007-10-20 02:01:07 +01:00
dm-path-selector.h
dm-raid1.c dm raid1: kcopyd should stop on error if errors handled 2008-10-10 13:36:59 +01:00
dm-round-robin.c dm: remove duplicate module name from error msgs 2007-07-12 15:01:08 -07:00
dm-snap.c dm snapshot: use per device mempools 2008-07-21 12:00:35 +01:00
dm-snap.h dm snapshot: use per device mempools 2008-07-21 12:00:35 +01:00
dm-stripe.c block: don't depend on consecutive minor space 2008-10-09 08:56:05 +02:00
dm-table.c dm: detect lost queue 2008-10-10 13:37:13 +01:00
dm-target.c dm: use kzalloc 2007-10-20 02:01:07 +01:00
dm-uevent.c md: replace remaining __FUNCTION__ occurrences 2008-04-28 08:58:42 -07:00
dm-uevent.h dm: uevent generate events 2007-10-20 02:01:26 +01:00
dm-zero.c Drop 'size' argument from bio_endio and bi_end_io 2007-10-10 09:25:57 +02:00
dm.c block: move stats from disk to part0 2008-10-09 08:56:08 +02:00
dm.h dm: publish dm_vcalloc 2008-10-10 13:37:12 +01:00
faulty.c md: check for memory allocation failure in faulty personality 2008-10-16 14:16:53 +11:00
Kconfig raid, fastboot: hide RAID autodetect option if MD is compiled as a module 2008-10-12 08:25:14 -07:00
linear.c md: Remove unnecessary #includes, #defines, and function declarations. 2008-10-13 11:55:12 +11:00
Makefile [SCSI] scsi_dh: Remove hardware handler infrastructure from dm 2008-06-05 09:23:42 -05:00
md.c md: fix input truncation in safe_delay_store() 2008-10-16 17:03:08 +11:00
mktables.c md: raid6: Fix mktable.c 2008-02-06 10:41:18 -08:00
multipath.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2008-10-17 09:00:23 -07:00
raid0.c md: Remove unnecessary #includes, #defines, and function declarations. 2008-10-13 11:55:12 +11:00
raid1.c md: build failure due to missing delay.h 2008-10-15 21:57:05 +11:00
raid5.c md: Relax minimum size restrictions on chunk_size. 2008-10-13 11:55:12 +11:00
raid6.h md: Remove unnecessary #includes, #defines, and function declarations. 2008-10-13 11:55:12 +11:00
raid6algos.c drivers/md: use time_before, time_before_eq, etc 2008-04-28 08:58:42 -07:00
raid6altivec.uc
raid6int.uc
raid6mmx.c x86 merge fallout: uml 2007-10-29 07:41:32 -07:00
raid6recov.c
raid6sse1.c x86 merge fallout: uml 2007-10-29 07:41:32 -07:00
raid6sse2.c x86 merge fallout: uml 2007-10-29 07:41:32 -07:00
raid6x86.h x86 merge fallout: uml 2007-10-29 07:41:32 -07:00
raid10.c md: build failure due to missing delay.h 2008-10-15 21:57:05 +11:00
unroll.pl