Skip to content

Adaptive read-ahead V7

Wu Fengguang lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest16 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16mm: delayed page activationinclude/linux/page-flags.h mm/page_alloc.c mm/swap.c +1 more+42 -54 replies
2/16mm: balance page aging between zonesinclude/linux/mmzone.h mm/page_alloc.c mm/vmscan.c+159 -220 replies
3/16radixtree: sync with mainlinelib/radix-tree.c+5 -70 replies
4/16radix-tree: look-aside cacheinclude/linux/radix-tree.h lib/radix-tree.c+255 -376 replies
5/16readahead: some preparationmm/readahead.c+167 -90 replies
6/16readahead: call schemeinclude/linux/mm.h include/linux/page-flags.h mm/filemap.c +1 more+239 -110 replies
7/16readahead: tunable parametersDocumentation/sysctl/vm.txt include/linux/mm.h include/linux/sysctl.h +3 more+139 -20 replies
8/16readahead: state based methodinclude/linux/fs.h mm/readahead.c mm/swap.c +1 more+355 -10 replies
9/16readahead: context based methodmm/readahead.c+342 -00 replies
10/16readahead: other methodsmm/readahead.c+111 -00 replies
11/16readahead: mandatory thrashing protectioninclude/linux/mm.h include/linux/page-flags.h mm/page_alloc.c +2 more+334 -10 replies
12/16readahead: events accountingmm/readahead.c+191 -20 replies
13/16readahead: page aging accountingmm/readahead.c+147 -10 replies
14/16readahead: laptop mode supportinclude/linux/writeback.h mm/page-writeback.c mm/readahead.c+37 -10 replies
15/16readahead: disable look-ahead for loopback filedrivers/block/loop.c include/linux/fs.h mm/readahead.c+15 -00 replies
16/16io: reduce lantencyfs/mpage.c mm/readahead.c+7 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/16] Adaptive read-ahead V7

This is the 7th version of adaptive read-ahead patch.

There are various code cleanups and polish ups:
- new tunable parameters: readahead_hit_rate/readahead_live_chunk
- support sparse sequential accesses
- delay look-ahead in laptop mode
- disable look-ahead for loopback file
- make mandatory thrashing protection more simple and robust
- attempt to improve responsiveness on large I/O request size

Support for sparse reads is disabled by default. One must increase /proc/sys/vm/readahead_hit_rate to explicitly enable it. Please refer to Documentation/sysctl/vm.txt for details.

Currently the linux kernel does not support inter-file read-ahead. Tero Grundstr?m takes an intresting approach that achieves it: pack a dir of small files into a loopback file with reiserfs filesystem, and turn on sparse read support. But be prepared to waste some memory by this way :(

For crazy laptop users who prefer aggressive read-ahead, here is the way:

# echo 10000 > /proc/sys/vm/readahead_ratio
# blockdev --setra 524280 /dev/hda      # this is the max possible value

Notes:
- It is still an untested feature.
- It is safer to use blockdev+fadvise to increase ra-max for a single file, which needs patching your movie player.
- Be sure to restore them to sane values in normal operations!

Regards,
Wu