proc_parse: Set bigger buffer for smaps FILE
We spend a lot of time reading the /proc/$pid/smaps file. The time is spent in two places: 1 kernel puts too many info into it 2 fgets pulls info in 1024-bytes chunks, info about one vma is typically bigger (up to 3k bytes) thus we call read() ~3 times per one vma, which increases the amount of time spent in kernel to re-fill this info Setting the internal buffer to PAGE_SIZE size reduces the amount of read()-s on ~60% during basic container dump. Setting bigger buffer doesn't work, as kernel's seq file engine feeds at most one page of data per read syscall regardless of the buffer size. Signed-off-by:Pavel Emelyanov <xemul@parallels.com> Acked-by:
Andrew Vagin <avagin@parallels.com>
Showing
Please
register
or
sign in
to comment