Archived
14
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/drivers/md
Mikulas Patocka 7ff14a3615 dm: unplug queues in threads
Remove an avoidable 3ms delay on some dm-raid1 and kcopyd I/O.

It is specified that any submitted bio without BIO_RW_SYNC flag may plug the
queue (i.e. block the requests from being dispatched to the physical device).

The queue is unplugged when the caller calls blk_unplug() function. Usually, the
sequence is that someone calls submit_bh to submit IO on a buffer. The IO plugs
the queue and waits (to be possibly joined with other adjacent bios). Then, when
the caller calls wait_on_buffer(), it unplugs the queue and submits the IOs to
the disk.

This was happenning:

When doing O_SYNC writes, function fsync_buffers_list() submits a list of
bios to dm_raid1, the bios are added to dm_raid1 write queue and kmirrord is
woken up.

fsync_buffers_list() calls wait_on_buffer().  That unplugs the queue, but
there are no bios on the device queue as they are still in the dm_raid1 queue.

wait_on_buffer() starts waiting until the IO is finished.

kmirrord is scheduled, kmirrord takes bios and submits them to the devices.

The submitted bio plugs the harddisk queue but there is no one to unplug it.
(The process that called wait_on_buffer() is already sleeping.)

So there is a 3ms timeout, after which the queues on the harddisks are
unplugged and requests are processed.

This 3ms timeout meant that in certain workloads (e.g. O_SYNC, 8kb writes),
dm-raid1 is 10 times slower than md raid1.

Every time we submit something asynchronously via dm_io, we must unplug the
queue actually to send the request to the device.

This patch adds an unplug call to kmirrord - while processing requests, it keeps
the queue plugged (so that adjacent bios can be merged); when it finishes
processing all the bios, it unplugs the queue to submit the bios.

It also fixes kcopyd which has the same potential problem. All kcopyd requests
are submitted with BIO_RW_SYNC.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
2008-04-25 13:26:57 +01:00
..
raid6test md: raid6: clean up the style of raid6test/test.c 2008-02-06 10:41:18 -08:00
.gitignore
bitmap.c md: reduce CPU wastage on idle md array with a write-intent bitmap 2008-03-10 18:01:19 -07:00
dm-bio-list.h
dm-bio-record.h
dm-crypt.c dm crypt: fix ctx pending 2008-03-28 14:45:22 -07:00
dm-delay.c
dm-emc.c
dm-exception-store.c dm: move include files 2008-04-25 13:26:55 +01:00
dm-hw-handler.c
dm-hw-handler.h
dm-io.c dm: unplug queues in threads 2008-04-25 13:26:57 +01:00
dm-ioctl.c dm ioctl: use uninitialized_var 2008-02-08 02:10:16 +00:00
dm-kcopyd.c dm: unplug queues in threads 2008-04-25 13:26:57 +01:00
dm-linear.c
dm-log.c dm: move include files 2008-04-25 13:26:55 +01:00
dm-mpath-hp-sw.c
dm-mpath-rdac.c
dm-mpath.c dm mpath: add missing static 2008-02-08 02:10:35 +00:00
dm-mpath.h
dm-path-selector.c
dm-path-selector.h
dm-raid1.c dm: unplug queues in threads 2008-04-25 13:26:57 +01:00
dm-round-robin.c
dm-snap.c dm: move include files 2008-04-25 13:26:55 +01:00
dm-snap.h dm kcopyd: clean interface 2008-04-25 13:26:44 +01:00
dm-stripe.c dm: stripe enhanced status return 2008-02-08 02:11:24 +00:00
dm-table.c Introduce path_put() 2008-02-14 21:13:33 -08:00
dm-target.c
dm-uevent.c
dm-uevent.h
dm-zero.c
dm.c dm kcopyd: remove redundant client counting 2008-04-25 13:26:52 +01:00
dm.h dm: expose macros 2008-04-25 13:26:53 +01:00
faulty.c md: change ITERATE_RDEV to rdev_for_each 2008-02-06 10:41:19 -08:00
Kconfig dm: targets no longer experimental 2008-02-08 02:10:32 +00:00
linear.c md: change ITERATE_RDEV to rdev_for_each 2008-02-06 10:41:19 -08:00
Makefile dm: move include files 2008-04-25 13:26:55 +01:00
md.c RAID: remove trailing space from printk line 2008-04-21 22:42:58 +00:00
mktables.c md: raid6: Fix mktable.c 2008-02-06 10:41:18 -08:00
multipath.c md: change ITERATE_RDEV to rdev_for_each 2008-02-06 10:41:19 -08:00
raid0.c md: change ITERATE_RDEV to rdev_for_each 2008-02-06 10:41:19 -08:00
raid1.c md: fix possible raid1/raid10 deadlock on read error during resync 2008-03-04 16:35:18 -08:00
raid5.c md: close a livelock window in handle_parity_checks5 2008-04-11 08:06:44 -07:00
raid6.h
raid6algos.c
raid6altivec.uc
raid6int.uc
raid6mmx.c
raid6recov.c
raid6sse1.c
raid6sse2.c
raid6x86.h
raid10.c md: the md RAID10 resync thread could cause a md RAID10 array deadlock 2008-03-04 16:35:18 -08:00
unroll.pl