Skip to content
Commit 95c2a4d6 authored by Pavel Emelyanov's avatar Pavel Emelyanov
Browse files

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: default avatarPavel Emelyanov <xemul@parallels.com>
Acked-by: default avatarAndrew Vagin <avagin@parallels.com>
parent c6a3b1de
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment