linux/drivers
Jon Derrick 8745faa956 md: Use optimal I/O size for last bitmap page
If the bitmap space has enough room, size the I/O for the last bitmap
page write to the optimal I/O size for the storage device. The expanded
write is checked that it won't overrun the data or metadata.

The drive this was tested against has higher latencies when there are
sub-4k writes due to device-side read-mod-writes of its atomic 4k write
unit. This change helps increase performance by sizing the last bitmap
page I/O for the device's preferred write unit, if it is given.

Example Intel/Solidigm P5520
Raid10, Chunk-size 64M, bitmap-size 57228 bits

$ mdadm --create /dev/md0 --level=10 --raid-devices=4 /dev/nvme{0,1,2,3}n1
        --assume-clean --bitmap=internal --bitmap-chunk=64M
$ fio --name=test --direct=1 --filename=/dev/md0 --rw=randwrite --bs=4k --runtime=60

Without patch:
  write: IOPS=1676, BW=6708KiB/s (6869kB/s)(393MiB/60001msec); 0 zone resets

With patch:
  write: IOPS=15.7k, BW=61.4MiB/s (64.4MB/s)(3683MiB/60001msec); 0 zone resets

Biosnoop:
Without patch:
Time        Process        PID     Device      LBA        Size      Lat
1.410377    md0_raid10     6900    nvme0n1   W 16         4096      0.02
1.410387    md0_raid10     6900    nvme2n1   W 16         4096      0.02
1.410374    md0_raid10     6900    nvme3n1   W 16         4096      0.01
1.410381    md0_raid10     6900    nvme1n1   W 16         4096      0.02
1.410411    md0_raid10     6900    nvme1n1   W 115346512  4096      0.01
1.410418    md0_raid10     6900    nvme0n1   W 115346512  4096      0.02
1.410915    md0_raid10     6900    nvme2n1   W 24         3584      0.43 <--
1.410935    md0_raid10     6900    nvme3n1   W 24         3584      0.45 <--
1.411124    md0_raid10     6900    nvme1n1   W 24         3584      0.64 <--
1.411147    md0_raid10     6900    nvme0n1   W 24         3584      0.66 <--
1.411176    md0_raid10     6900    nvme3n1   W 2019022184 4096      0.01
1.411189    md0_raid10     6900    nvme2n1   W 2019022184 4096      0.02

With patch:
Time        Process        PID     Device      LBA        Size      Lat
5.747193    md0_raid10     727     nvme0n1   W 16         4096      0.01
5.747192    md0_raid10     727     nvme1n1   W 16         4096      0.02
5.747195    md0_raid10     727     nvme3n1   W 16         4096      0.01
5.747202    md0_raid10     727     nvme2n1   W 16         4096      0.02
5.747229    md0_raid10     727     nvme3n1   W 1196223704 4096      0.02
5.747224    md0_raid10     727     nvme0n1   W 1196223704 4096      0.01
5.747279    md0_raid10     727     nvme0n1   W 24         4096      0.01 <--
5.747279    md0_raid10     727     nvme1n1   W 24         4096      0.02 <--
5.747284    md0_raid10     727     nvme3n1   W 24         4096      0.02 <--
5.747291    md0_raid10     727     nvme2n1   W 24         4096      0.02 <--
5.747314    md0_raid10     727     nvme2n1   W 2234636712 4096      0.01
5.747317    md0_raid10     727     nvme1n1   W 2234636712 4096      0.02

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jon Derrick <jonathan.derrick@linux.dev>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20230224183323.638-4-jonathan.derrick@linux.dev
2023-04-13 22:20:24 -07:00
..
accel - Daniel Verkamp has contributed a memfd series ("mm/memfd: add 2023-02-23 17:09:35 -08:00
accessibility
acpi More ACPI updates for 6.3-rc1 2023-03-03 10:36:01 -08:00
amba
android Char/Misc and other driver subsystem changes for 6.3-rc1 2023-02-24 12:47:33 -08:00
ata ata: ahci: Revert "ata: ahci: Add Tiger Lake UP{3,4} AHCI controller" 2023-03-03 18:43:02 +09:00
atm
auxdisplay
base A set of updates for the interrupt susbsystem: 2023-03-05 11:19:16 -08:00
bcma
block block: null_blk: make fault-injection dynamically configurable per device 2023-04-13 07:38:55 -06:00
bluetooth
bus ARM: SoC drivers for 6.3 2023-02-27 10:04:49 -08:00
cdrom
char tpm: disable hwrng for fTPM on some AMD designs 2023-03-12 23:28:10 +02:00
clk We have one small patch to the clk core this time around. It fixes a corner 2023-02-25 15:16:23 -08:00
clocksource Updates for timekeeping, timers and clockevent/source drivers: 2023-02-21 09:45:13 -08:00
comedi
connector
counter
cpufreq More power management updates for 6.3-rc1 2023-03-03 10:30:58 -08:00
cpuidle ARM: SoC drivers for 6.3 2023-02-27 10:04:49 -08:00
crypto This push fixes a regression in the caam driver. 2023-03-05 11:32:30 -08:00
cxl cxl for v6.3 2023-02-25 09:19:23 -08:00
dax cxl for v6.3 2023-02-25 09:19:23 -08:00
dca
devfreq
dio
dma dmaengine updates for v6.3 2023-02-24 17:18:54 -08:00
dma-buf dma-buf: make kobj_type structure constant 2023-02-17 09:16:34 +01:00
edac - Add a driver for the RAS functionality on Xilinx's on chip memory 2023-02-21 08:10:03 -08:00
eisa
extcon
firewire Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
firmware ARM: SoC drivers for 6.3 2023-02-27 10:04:49 -08:00
fpga Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
fsi
gnss
gpio Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
gpu Merge tag 'amd-drm-fixes-6.3-2023-03-09' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes 2023-03-10 14:17:35 +10:00
greybus
hid for-linus-2023030901 2023-03-09 10:17:23 -08:00
hsi Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
hte
hv Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
hwmon - Core Frameworks 2023-02-23 15:03:05 -08:00
hwspinlock
hwtracing Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
i2c i2c: dev: Fix bus callback return values 2023-03-09 22:07:52 +01:00
i3c I3C for 6.3 2023-02-28 16:05:01 -08:00
idle Power management updates for 6.3-rc1 2023-02-21 12:13:58 -08:00
iio Char/Misc and other driver subsystem changes for 6.3-rc1 2023-02-24 12:47:33 -08:00
infiniband v6.3 RDMA pull request 2023-02-24 15:11:03 -08:00
input ARM: SoC drivers for 6.3 2023-02-27 10:04:49 -08:00
interconnect SoC: DT changes for 6.3 2023-02-20 15:49:56 -08:00
iommu ARM: SoC drivers for 6.3 2023-02-27 10:04:49 -08:00
ipack Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
irqchip ARM: 2023-02-25 11:30:21 -08:00
isdn
leds - Remove Drivers 2023-02-23 15:09:31 -08:00
macintosh powerpc updates for 6.3 2023-02-25 11:00:06 -08:00
mailbox mailbox: qcom-apcs-ipc: add IPQ5332 APSS clock support 2023-02-23 14:47:13 -06:00
mcb
md md: Use optimal I/O size for last bitmap page 2023-04-13 22:20:24 -07:00
media media: i2c: ov2685: convert to i2c's .probe_new() 2023-03-09 21:59:04 +01:00
memory ARM: SoC drivers for 6.3 2023-02-27 10:04:49 -08:00
memstick MMC core: 2023-02-27 09:47:26 -08:00
message
mfd Including fixes from wireless and netfilter. 2023-02-27 14:05:08 -08:00
misc misc: ad525x_dpot-i2c: Convert to i2c's .probe_new() 2023-03-09 21:58:45 +01:00
mmc ARM: SoC drivers for 6.3 2023-02-27 10:04:49 -08:00
most
mtd * regression fix for the notifier handling of the I2C core 2023-03-11 09:24:05 -08:00
mux
net Networking fixes for 6.3-rc2, including fixes from netfilter, bpf 2023-03-09 10:56:58 -08:00
nfc nfc: fdp: add null check of devm_kmalloc_array in fdp_nci_i2c_read_device_properties 2023-02-28 11:48:28 +01:00
ntb
nubus
nvdimm virtio,vhost,vdpa: features, fixes 2023-02-25 11:48:02 -08:00
nvme block-6.3-2023-03-03 2023-03-03 10:21:39 -08:00
nvmem
of IOMMU Updates for Linux v6.3: 2023-02-24 13:40:13 -08:00
opp OPP: fix error checking in opp_migrate_dentry() 2023-02-16 13:48:53 +01:00
parisc
parport Char/Misc and other driver subsystem changes for 6.3-rc1 2023-02-24 12:47:33 -08:00
pci A set of updates for the interrupt susbsystem: 2023-03-05 11:19:16 -08:00
pcmcia Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
peci
perf RISC-V Patches for the 6.3 Merge Window, Part 2 2023-03-03 09:32:51 -08:00
phy ARM: SoC drivers for 6.3 2023-02-27 10:04:49 -08:00
pinctrl ARM: SoC drivers for 6.3 2023-02-27 10:04:49 -08:00
platform platform: mellanox: mlx-platform: Initialize shift variable to 0 2023-03-07 12:08:30 +01:00
pnp
power power supply changes for the v6.3 series (part 2) 2023-03-03 16:33:28 -08:00
powercap More power management updates for 6.3-rc1 2023-03-03 10:30:58 -08:00
pps
ps3
ptp ptp: vclock: use mutex to fix "sleep on atomic" bug 2023-02-22 21:23:48 -08:00
pwm pwm: dwc: Use devm_pwmchip_add() 2023-02-20 12:26:35 +01:00
rapidio
ras
regulator regulator: Fixes for v6.3 2023-03-02 09:21:25 -08:00
remoteproc ARM: SoC drivers for 6.3 2023-02-27 10:04:49 -08:00
reset
rpmsg rpmsg updates for v6.3 2023-02-26 12:10:28 -08:00
rtc RTC for 6.3 2023-03-03 09:15:50 -08:00
s390 s390/dasd: fix hanging blockdevice after request requeue 2023-04-11 19:53:08 -06:00
sbus
scsi SCSI fixes on 20230310 2023-03-10 20:45:53 -08:00
sh sh updates for v6.3 2023-03-01 09:44:22 -08:00
siox
slimbus
soc ARM: SoC drivers for 6.3 2023-02-27 10:04:49 -08:00
soundwire soundwire updates for 6.3 2023-02-24 17:29:52 -08:00
spi spi: Fixes for v6.3 2023-03-02 09:25:38 -08:00
spmi
ssb
staging staging: r8188eu: delete driver 2023-03-09 10:06:28 +01:00
target scsi: target: iscsi: Fix an error message in iscsi_check_key() 2023-03-06 16:50:42 -05:00
tc
tee Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
thermal thermal: intel: int340x: processor_thermal: Fix deadlock 2023-03-03 20:34:49 +01:00
thunderbolt Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
tty serial: sc16is7xx: Convert to i2c's .probe_new() 2023-03-09 21:58:53 +01:00
ufs scsi: ufs: mcq: qcom: Clean the return path of ufs_qcom_mcq_config_resource() 2023-03-06 18:33:12 -05:00
uio - Daniel Verkamp has contributed a memfd series ("mm/memfd: add 2023-02-23 17:09:35 -08:00
usb phy-for-6.3 2023-02-24 17:22:11 -08:00
vdpa virtio,vhost,vdpa: features, fixes 2023-02-25 11:48:02 -08:00
vfio VFIO updates for v6.3-rc1 2023-02-25 11:52:57 -08:00
vhost virtio,vhost,vdpa: features, fixes 2023-02-25 11:48:02 -08:00
video TTY/Serial driver updates for 6.3-rc1 2023-02-24 12:17:14 -08:00
virt virt/sev-guest: Return -EIO if certificate buffer is not large enough 2023-03-01 10:17:46 +01:00
virtio virtio,vhost,vdpa: features, fixes 2023-02-25 11:48:02 -08:00
vlynq
w1 w1: ds2482: Convert to i2c's .probe_new() 2023-03-09 21:58:57 +01:00
watchdog linux-watchdog 6.3-rc1 tag 2023-03-02 11:12:01 -08:00
xen Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
zorro
Kconfig
Makefile Kbuild updates for v6.3 2023-02-26 11:53:25 -08:00