Skip to content

Commit 10ca216

Browse files
jankaramwilck
authored andcommitted
udevrules: Add rule to set maximum readahead window
Add udev rule to allow tuning the maximum readahead window for the devices. Also set the default maximum readahead window to 1MB as it noticeably improves througput for fast NVME drives. For example from 3.6 GB/s with 128k readahead window to 5.0 GB/s with 1MB readahead window. Signed-off-by: Jan Kara <[email protected]>
1 parent 282e930 commit 10ca216

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

udevrules/60-tune-readahead.rules

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# --- DO NOT EDIT THIS PART ----
2+
SUBSYSTEM!="block", GOTO="readahead_end"
3+
ACTION!="add|change", GOTO="readahead_end"
4+
ENV{DEVTYPE}!="disk", GOTO="readahead_end"
5+
TEST!="%S%p/queue/read_ahead_kb", GOTO="readahead_end"
6+
7+
# For dm devices, the relevant events are "change" events, see 10-dm.rules
8+
ACTION!="change", KERNEL=="dm-*", GOTO="readahead_end"
9+
10+
# --- EDIT BELOW HERE after copying to /etc/udev/rules.d ---
11+
12+
# Set maximum readahead to 1MB
13+
ATTR{queue/read_ahead_kb}="1024"
14+
15+
# --- EDIT ABOVE HERE after copying to /etc/udev/rules.d ---
16+
LABEL="readahead_end"
17+

0 commit comments

Comments
 (0)