linux-uconsole/include
Changheun Lee 9458fa0dda BACKPORT: bio: limit bio max size
bio size can grow up to 4GB when muli-page bvec is enabled.
but sometimes it would lead to inefficient behaviors.
in case of large chunk direct I/O, - 32MB chunk read in user space -
all pages for 32MB would be merged to a bio structure if the pages
physical addresses are contiguous. it makes some delay to submit
until merge complete. bio max size should be limited to a proper size.

When 32MB chunk read with direct I/O option is coming from userspace,
kernel behavior is below now in do_direct_IO() loop. it's timeline.

 | bio merge for 32MB. total 8,192 pages are merged.
 | total elapsed time is over 2ms.
 |------------------ ... ----------------------->|
                                                 | 8,192 pages merged a bio.
                                                 | at this time, first bio submit is done.
                                                 | 1 bio is split to 32 read request and issue.
                                                 |--------------->
                                                  |--------------->
                                                   |--------------->
                                                              ......
                                                                   |--------------->
                                                                    |--------------->|
                          total 19ms elapsed to complete 32MB read done from device. |

If bio max size is limited with 1MB, behavior is changed below.

 | bio merge for 1MB. 256 pages are merged for each bio.
 | total 32 bio will be made.
 | total elapsed time is over 2ms. it's same.
 | but, first bio submit timing is fast. about 100us.
 |--->|--->|--->|---> ... -->|--->|--->|--->|--->|
      | 256 pages merged a bio.
      | at this time, first bio submit is done.
      | and 1 read request is issued for 1 bio.
      |--------------->
           |--------------->
                |--------------->
                                      ......
                                                 |--------------->
                                                  |--------------->|
        total 17ms elapsed to complete 32MB read done from device. |

As a result, read request issue timing is faster if bio max size is limited.
Current kernel behavior with multipage bvec, super large bio can be created.
And it lead to delay first I/O request issue.

Signed-off-by: Changheun Lee <nanich.lee@samsung.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20210503095203.29076-1-nanich.lee@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Bug: 182716953
(cherry picked from commit cd2c7545ae)
Change-Id: Ie3876daa495535dc7f856ed9a281e65d72a437c1
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-05-07 07:14:07 -07:00
..
acpi ACPI: scan: Use unique number for instance_no 2021-03-30 14:32:06 +02:00
asm-generic Merge 5.10.27 into android12-5.10 2021-04-02 15:25:50 +02:00
clocksource
crypto Merge 5.10.22 into android12-5.10 2021-03-11 19:35:01 +01:00
drm UPSTREAM: drm/drm_vblank: set the dma-fence timestamp during send_vblank_event 2021-04-07 14:20:07 +00:00
dt-bindings UPSTREAM: dt-bindings: mediatek: Add binding for mt8192 IOMMU 2021-03-24 12:45:11 -07:00
keys
kunit
kvm FROMGIT: KVM: arm64: Turn kvm_arm_support_pmu_v3() into a static key 2021-03-05 16:45:13 +00:00
linux BACKPORT: bio: limit bio max size 2021-05-07 07:14:07 -07:00
math-emu
media This is the 5.10.24 stable release 2021-03-19 09:42:56 +01:00
memory
misc
net Revert "Revert "net: xfrm: Localize sequence counter per network namespace"" 2021-04-23 18:42:38 -07:00
pcmcia
ras
rdma RDMA: Lift ibdev_to_node from rds to common code 2021-02-26 10:12:59 +01:00
scsi scsi: libsas: Introduce a _gfp() variant of event notifiers 2021-03-25 09:04:11 +01:00
soc UPSTREAM: memory: mtk-smi: Allow building as module 2021-03-24 12:45:16 -07:00
sound FROMGIT: ASoC: soc-component: Add snd_soc_pcm_component_ack 2021-04-23 18:42:37 -07:00
target scsi: target: core: Add cmd length set before cmd complete 2021-03-17 17:06:25 +01:00
trace ANDROID: i2c: Add vendor hook to allow assign dev_name to I2C devices 2021-05-07 07:13:22 -07:00
uapi UPSTREAM: binder: tell userspace to dump current backtrace when detected oneway spamming 2021-05-07 07:13:22 -07:00
vdso
video
xen Xen/gntdev: correct error checking in gntdev_map_grant_pages() 2021-02-23 15:53:24 +01:00
OWNERS ANDROID: Add OWNERS files referring to the respective android-mainline OWNERS 2021-04-03 14:11:30 +00:00