[Feature] [HMEM] VMA based swap readahead
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
intel |
Fix Released
|
Undecided
|
Unassigned | ||
linux (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Description
The swap readahead is a important mechanism to reduce the swap in
latency. But the original swap readahead algorithm has some issues.
a) The original swap readahead algorithm does readahead based on the
consecutive blocks in swap device. But the consecutive blocks in
swap device just reflect the order of page reclaiming, but don't
necessarily reflect the access sequence in RAM. Although for some
workloads (such as whole system pure sequential workload), it
works, but in general, it doesn't work well for more complex access
pattern, such as combined workloads (sequential and random workload
runs together) or changing accessing patterns in workload.
b) The original swap readahead algorithm just turns random read into
sequential read, but doesn’t parallel CPU and disk operations.
This can reduce the average latency and the lowest latency, but
doesn’t help much for high percentile latency (like 90%, 95%,
99%).
To solve the above issues, A VMA based swap readahead algorithm is designed.
When the page fault occurs, the pages along the access direction will
be checked and the swapped out pages will be readahead if they fall
inside the readahead window. There is one readahead window state for
each VMA, to reflect the different access patterns for different VMAs.
The readahead window is scaled based on whether the accessed page is
consecutive in virtual address with the previous accessed page. If
so, the readahead window will be extended, otherwise, the readahead
window will be shrunk rapidly.
Target Kernel: 4.14
Target Release: 18.04
information type: | Proprietary → Private |
Merged in V4.14-rc1.
81a0298bdfab mm, swap: don't use VMA based swap readahead if HDD is used as swap
d9bfcfdc41e8 mm, swap: add sysfs interface for VMA based swap readahead
ec560175c0b6 mm, swap: VMA based swap readahead
c4fa63092f21 mm, swap: fix swap readahead marking
cbc65df240c1 mm, swap: add swap readahead hit statistics