| Age | Commit message (Collapse) | Author |
|
This patch uses find_vma() to improve the read response of /proc/pid/maps.
It attempts to make the liner scan instead of quadratic walk and utilise rb
tree. Reading the file was doing sequential scan from the begining to file
position all the time, and taking a quite long time.
The improvements came from f_version/m_version and resulting in mmap_cache
match. Even if mmap_cache does not match, rb tree walk should be faster
than sequential walk. First attempt was to put the state across read
system calls into private data. Later got inspiration from wli's pid patch
using f_version in readdir of /proc. Other advantage is, f_version will be
cleared automatically by lseek.
The test program creates 32K maps and splits them into two(limited by
max_map_count sysctl) using mprotect(0). After the patch, the read time
improves from many seconds to milliseconds, and does not grow superlinearly
with number of read calls.
Help taken from Peter Swain in idea and testing.
After the patch:
Reading /proc/self/maps:65528 time: 0 secs and 780728 usecs buf:4096 bytes:3811362
Reading /proc/self/maps:65528 time: 1 secs and 117573 usecs buf:1024 bytes:3866627
Reading /proc/self/maps:65528 time: 0 secs and 473459 usecs buf: 256 bytes:3866627
Reading /proc/self/maps:65528 time: 0 secs and 901288 usecs buf: 64 bytes:3866627
Reading /proc/self/maps:65528 time: 1 secs and 480185 usecs buf: 16 bytes:3866627
Reading /proc/self/maps:65528 time: 1 secs and 636268 usecs buf: 4 bytes:3866627
Reading /proc/self/maps:65528 time: 4 secs and 118327 usecs buf: 1 bytes:3866627
Before the patch:
Reading /proc/self/maps:65528 time: 4 secs and 359556 usecs buf:4096 bytes:3866647
Reading /proc/self/maps:65528 time:16 secs and 218584 usecs buf:1024 bytes:3866688
Reading /proc/self/maps:65528 time:67 secs and 870200 usecs buf: 256 bytes:3866688
Reading /proc/self/maps:65528 time:255 secs and 186934 usecs buf: 64 bytes:3866688
Small reads never completed.
Signed-off-by: Prasanna Meda <pmeda@akamai.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Saves 3.4k from my vmlinux.
Thanks to Denis Vlasenko <vda@port.imtp.ilyichevsk.odessa.ua> for performing
the analysis.
|
|
Code that includes seq_file.h uses a magic pointer "(void*)1"
to start a header seq_printf.
This patch adds a #define, so that people can start writing more
readable code.
|
|
This adds a new seq_...() helper:
seq_path(seq_file, mnt, dentry, escape)
It spits the pathname into seq_file, does octal escapes for given set of
characters, returns the number of characters it'd produced or -1 in case
of error. Long names are handled gracefully - you don't need anything
to do, generic seq_file logics will do the right thing.
/proc/mounts and /proc/swaps are converted to use of seq_path(), some
junk removed.
/proc/pid/maps will be converted next.
|
|
|
|
|
|
new helpers for seq_file - for cases where we don't have a non-trivial
iterator and just want to use seq_{printf,putc,...}.
|
|
include/linux/seq_file.h uses memcpy and struct semaphore and so should
include the relevant files.
|
|
- Al Viro: more superblock cleanups
- Jens Axboe: more patches for new block IO layer
- Christoph Hellwig: get rid of the old, long- deprecated SCSI error
handling
|
|
- Alan Cox: more driver merging
- Al Viro: make ext2 group allocation more readable
|