From a2f3d3c35858591046a7911ef6ebf8c1c2950aaa Mon Sep 17 00:00:00 2001 From: Alex Naidis Date: Mon, 30 Jan 2017 14:08:58 +0100 Subject: [PATCH] miatoll: Override readahead to 128KiB after post-boot * Qualcomm decided to increase the read-ahead value to 512KiB [1]. * This value resulted in frequent cases where read-ahead would be waiting for new I/O requests and thus ending up being synchronous rather than asynchronous. * As result, the main goal of Qualcomm's patch [1] which is to increase throughput ends up in a regression where read throughput is significantly lower than it ever would be with the recommended [2] read-ahead value. * This patch uses our existing loop in ramdisk to set the read-ahead value to 128KiB. [1] https://source.codeaurora.org/quic/la/kernel/msm-4.19/commit/include/linux/mm.h?h=LA.UM.9.12.r1-09000-SMxx50.0&id=25d04e4ceb7c067907901842c223d62973d73a75 [2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/include/linux/mm.h?h=v4.19.160#n2397 Change-Id: I1980d904568fe4f1ce7b676452bcc44e4689f02f Signed-off-by: Adithya R --- rootdir/etc/init.device.rc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/rootdir/etc/init.device.rc b/rootdir/etc/init.device.rc index 12a831a..d0e7d23 100644 --- a/rootdir/etc/init.device.rc +++ b/rootdir/etc/init.device.rc @@ -83,3 +83,16 @@ on property:vendor.post_boot.parsed=1 write /sys/block/zram0/comp_algorithm lz4 write /sys/block/zram0/max_comp_streams 8 write /proc/sys/vm/page-cluster 0 + + # Override readahead to 128KiB + write /sys/block/dm-0/queue/read_ahead_kb 128 + write /sys/block/dm-1/queue/read_ahead_kb 128 + write /sys/block/dm-2/queue/read_ahead_kb 128 + write /sys/block/dm-3/queue/read_ahead_kb 128 + write /sys/block/mmcblk0/queue/read_ahead_kb 128 + write /sys/block/sda/queue/read_ahead_kb 128 + write /sys/block/sdb/queue/read_ahead_kb 128 + write /sys/block/sdc/queue/read_ahead_kb 128 + write /sys/block/sdd/queue/read_ahead_kb 128 + write /sys/block/sde/queue/read_ahead_kb 128 + write /sys/block/sdf/queue/read_ahead_kb 128