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
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
..
acorn/char
acpi Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/juhl/trivial 2008-04-21 16:36:46 -07:00
amba
ata Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6 2008-04-21 15:49:58 -07:00
atm drivers/atm: use time_before, time_before_eq, etc 2008-04-19 18:14:50 -07:00
auxdisplay
base bus_remove_device: be more careful about incomplete initialization 2008-04-22 17:40:36 -07:00
block fix brd allocation flags 2008-04-22 13:38:03 -07:00
bluetooth hci_usb: remove code obfuscation 2008-04-19 18:17:26 -07:00
cdrom cdrom: use kmalloced buffers instead of buffers on stack 2008-04-21 09:50:08 +02:00
char Blackfin char driver for Blackfin on-chip OTP memory (v3) 2008-04-25 08:04:56 +08:00
clocksource tclib: Fix compile warnings 2008-03-13 22:53:29 +01:00
connector connector: convert to single-threaded workqueue 2008-03-23 21:51:12 -07:00
cpufreq
cpuidle cpuidle: fix 100% C0 statistics regression 2008-03-26 00:58:19 -04:00
crypto [CRYPTO] padlock-aes: Use generic setkey function 2008-04-21 10:19:34 +08:00
dca
dio
dma DMA engine: typo fixes 2008-04-21 22:38:45 +00:00
edac
eisa
firewire Convert asm/semaphore.h users to linux/semaphore.h 2008-04-18 22:22:54 -04:00
firmware Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6 2008-04-21 15:49:58 -07:00
gpio gpio/pca953x bugfix: mark as can_sleep 2008-03-10 18:01:19 -07:00
hid HID: Suppress hidinput for Samsung IR control 2008-04-22 11:34:59 +02:00
hwmon hwmon: (w83781d) Fix I/O resource conflict with PNP 2008-03-27 08:40:41 -04:00
i2c i2c: Fix platform driver hotplug/coldplug 2008-04-22 22:16:49 +02:00
ide cdrom: make unregister_cdrom() return void 2008-04-21 09:50:08 +02:00
ieee1394 Convert asm/semaphore.h users to linux/semaphore.h 2008-04-18 22:22:54 -04:00
infiniband IB/ipath: Correct capitalization "IntX" -> "INTx" 2008-04-21 18:19:15 -07:00
input pcsp - Don't build pcspkr when snd-pcsp is enabled 2008-04-24 12:00:42 +02:00
isdn Merge branch 'irq-cleanups-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/misc-2.6 2008-04-21 15:56:19 -07:00
leds Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-04-23 12:23:45 -07:00
lguest drivers: Remove unnecessary inclusions of asm/semaphore.h 2008-04-18 22:16:32 -04:00
macintosh Convert asm/semaphore.h users to linux/semaphore.h 2008-04-18 22:22:54 -04:00
mca
md dm: unplug queues in threads 2008-04-25 13:26:57 +01:00
media Merge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb 2008-04-24 11:21:08 -07:00
memstick memstick: convert struct class_device to struct device 2008-04-19 19:10:29 -07:00
message SCSI: convert struct class_device to struct device 2008-04-19 19:10:33 -07:00
mfd Merge branch 'fixes' of master.kernel.org:/home/rmk/linux-2.6-arm 2008-04-24 08:36:11 -07:00
misc [IA64] run drivers/misc/sgi-xp through scripts/checkpatch.pl 2008-04-22 15:08:55 -07:00
mmc mmc: sdio_ops.c should #include "sdio_ops.h" 2008-04-18 20:05:33 +02:00
mtd Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2008-04-21 15:50:49 -07:00
net Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/blackfin-2.6 2008-04-24 09:33:34 -07:00
nubus
of [POWERPC] i2c: Fix build breakage introduced by OF helpers 2008-04-20 13:03:35 +10:00
oprofile
parisc PCI: remove parisc consumer of the pci global_list 2008-04-20 21:47:01 -07:00
parport avr32: don't offer PARPORT_PC 2008-04-19 20:40:10 -04:00
pci intel-iommu.c: dma ops fix 2008-04-24 23:15:43 +02:00
pcmcia [ARM] pxa: fix 0e623941be 2008-04-21 12:52:03 +01:00
pnp pnpacpi: fix potential corruption on "pnpacpi: exceeded the max number of IRQ resources 2" 2008-04-23 12:22:13 -07:00
power
ps3 [POWERPC] PS3: Sys-manager Wake-on-LAN support 2008-04-01 20:43:08 +11:00
rapidio
rtc rtc: rtc-sh: Add support for periodic IRQs. 2008-04-18 09:50:01 -07:00
s390 Convert asm/semaphore.h users to linux/semaphore.h 2008-04-18 22:22:54 -04:00
sbus
scsi Merge branch 'for-2.6.26' of git://git.kernel.dk/linux-2.6-block 2008-04-21 16:03:40 -07:00
serial Blackfin Serial Driver: fix bug - use mod_timer to replace only add_timer. 2008-04-25 04:36:47 +08:00
sh
sn ioc3.c: replace remaining __FUNCTION__ occurrences 2008-03-17 08:11:48 -04:00
spi spi: spi_s3c24xx must initialize num_chipselect 2008-04-15 19:35:41 -07:00
ssb ssb: Fix all-ones boardflags 2008-04-23 21:25:35 -04:00
tc
telephony
thermal acpi thermal trip points increased to 12 2008-04-15 19:35:41 -07:00
uio UIO: hold a reference to the device's owner while the device is open 2008-04-19 19:10:18 -07:00
usb Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6 2008-04-21 15:44:57 -07:00
video Merge branch 'merge-fixes' into devel 2008-04-19 17:17:34 +01:00
virtio virtio: remove overzealous BUG_ON. 2008-04-07 13:14:22 -07:00
w1
watchdog Convert asm/semaphore.h users to linux/semaphore.h 2008-04-18 22:22:54 -04:00
xen xen: fix grant table bug 2008-04-04 18:36:46 +02:00
zorro
Kconfig
Makefile