Linux kernel source tree
Go to file
Damien Le Moal 459779d04a block: Improve read ahead size for rotational devices
For a device that does not advertize an optimal I/O size, the function
blk_apply_bdi_limits() defaults to an initial setting of the ra_pages
field of struct backing_dev_info to VM_READAHEAD_PAGES, that is, 128 KB.

This low I/O size value is far from being optimal for hard-disk devices:
when reading files from multiple contexts using buffered I/Os, the seek
overhead between the small read commands generated to read-ahead
multiple files will significantly limit the performance that can be
achieved.

This fact applies to all ATA devices as ATA does not define an optimal
I/O size and the SCSI SAT specification does not define a default value
to expose to the host.

Modify blk_apply_bdi_limits() to use a device max_sectors limit to
calculate the ra_pages field of struct backing_dev_info, when the device
is a rotational one (BLK_FEAT_ROTATIONAL feature is set). For a SCSI
disk, this defaults to 2560 KB, which significantly improve performance
for buffered reads. Using XFS and sequentially reading randomly selected
(large) files stored on a SATA HDD, the maximum throughput achieved with
8 readers reading files with 1MB buffered I/Os increases from 122 MB/s
to 167 MB/s (+36%). The improvement is even larger when reading files
using 128 KB buffered I/Os, with a throughput increasing from 57 MB/s to
165 MB/s (+189%).

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20250616062856.1629897-1-dlemoal@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2025-07-29 06:22:33 -06:00
arch platform-drivers-x86 for v6.17-1 2025-07-28 23:21:28 -07:00
block block: Improve read ahead size for rotational devices 2025-07-29 06:22:33 -06:00
certs
crypto Crypto library updates for 6.17 2025-07-28 17:58:52 -07:00
Documentation platform-drivers-x86 for v6.17-1 2025-07-28 23:21:28 -07:00
drivers chrome-platform: Updates for v6.17 2025-07-28 23:26:07 -07:00
fs fscrypt updates for 6.17 2025-07-28 18:07:38 -07:00
include platform-drivers-x86 for v6.17-1 2025-07-28 23:21:28 -07:00
init for-6.17/io_uring-20250728 2025-07-28 16:30:12 -07:00
io_uring for-6.17/io_uring-20250728 2025-07-28 16:30:12 -07:00
ipc vfs-6.17-rc1.mmap_prepare 2025-07-28 13:43:25 -07:00
kernel Power management updates for 6.17-rc1 2025-07-28 20:13:36 -07:00
lib Crypto library tests for 6.17 2025-07-28 18:02:58 -07:00
LICENSES LICENSES: add CC0-1.0 license text 2025-05-21 14:54:17 +02:00
mm ACPI updates for 6.17-rc1 2025-07-28 20:44:42 -07:00
net Crypto library updates for 6.17 2025-07-28 17:58:52 -07:00
rust regulator: Updates for v6.17 2025-07-28 22:52:02 -07:00
samples Landlock update for v6.17-rc1 2025-07-28 19:21:32 -07:00
scripts Crypto library tests for 6.17 2025-07-28 18:02:58 -07:00
security Landlock update for v6.17-rc1 2025-07-28 19:21:32 -07:00
sound ASoC: Updates for v6.17 2025-07-24 14:47:49 +02:00
tools Power management updates for 6.17-rc1 2025-07-28 20:13:36 -07:00
usr
virt KVM: Allow CPU to reschedule while setting per-page memory attributes 2025-06-24 12:20:17 -07:00
.clang-format
.clippy.toml
.cocciconfig
.editorconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap 11 hotfixes. 9 are cc:stable and the remainder address post-6.15 issues 2025-07-24 19:13:30 -07:00
.pylintrc
.rustfmt.toml
COPYING
CREDITS mm: update MAINTAINERS entry for HMM 2025-07-19 19:26:16 -07:00
Kbuild
Kconfig
MAINTAINERS platform-drivers-x86 for v6.17-1 2025-07-28 23:21:28 -07:00
Makefile hardening updates for v6.17-rc1 2025-07-28 17:16:12 -07:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the reStructuredText markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.