bcc-readahead - Man Page

Show performance of read-ahead cache

Synopsis

readahead [-d DURATION]

Description

The tool shows the performance of read-ahead caching on the system under a given load to investigate any  caching issues. It shows a count of unused pages in the cache and also prints a histogram showing how  long they have remained there.

This tool traces the __do_page_cache_readahead() kernel function to track entry and exit in the readahead mechanism in the kernel and then uses __page_cache_alloc() and mark_page_accessed()  functions to calculate the age of the page in the cache as well as see how many are left unaccessed.

Since this uses BPF, only the root user can use this tool.

Note on Kprobes Usage

Since the tool uses Kprobes, depending on your linux kernel's compilation, these functions may be inlined  and hence not available for Kprobes. To see whether you have the functions available, check vmlinux  source and binary to confirm whether inlining is happening or not. You can also check /proc/kallsyms  on the host and verify if the target functions are present there before using this.

Requirements

CONFIG_BPF, bcc

Options

-h Print usage message

-d DURATION

Trace the read-ahead caching system for DURATION seconds

Examples

Trace for 30 seconds and show  histogram of page age (ms) in read-ahead cache along with unused page count:

# readahead -d 30

Overhead

The kernel functions instrumented by this program could be high-frequency depending on the profile of the  application (for example sequential IO). We advise the users to measure and monitor the overhead before leaving  this turned on in production environments.

Source

This originated as a bpftrace tool from the book "BPF Performance Tools", published by Addison Wesley (2019):

http://www.brendangregg.com/bpf-performance-tools-book.html

See the book for more documentation on this tool.

This version is in the BCC repository:

https://github.com/iovisor/bcc

Also look in the bcc distribution for a companion _examples.txt file containing example usage, output, and commentary for this tool.

OS

Linux

Stability

Unstable - in development.

Author

Suchakra Sharma

See Also

readahead(2), madvise(2)

Referenced By

nfsrahead(5).

2020-08-20 USER COMMANDS