[lkml]   [2020]   [Dec]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 2/3] perf tools: Skip MMAP record synthesis for kernel threads
On Mon, Dec 28, 2020 at 8:50 PM Jiri Olsa <> wrote:
> On Mon, Dec 21, 2020 at 04:00:28PM +0900, Namhyung Kim wrote:
> > To synthesize information to resolve sample IPs, it needs to scan task
> > and mmap info from the /proc filesystem. For each process, it
> > opens (and reads) status and maps file respectively. But as kernel
> > threads don't have memory maps so we can skip the maps file.
> >
> > To find kernel threads, check "VmPeak:" line in /proc/<PID>/status
> > file. It's about the peak virtual memory usage so only user-level
> > tasks have that. Also check "Threads:" line (which follows the VmPeak
> > line whether or not it exists) to be sure it's read enough data - just
> > in case of deeply nested pid namespaces or large number of
> > supplementary groups are involved.
> how much does this save? for kernel threads the maps file is empty
> and we just open the file and close
> also perhaps just stat(".....maps") and check the size would be easier?

The numbers are in the cover letter and it's around 5% on an idle
machine which has mostly kernel threads. I think most of the win
came from this change.

It's just to avoid those syscalls, so I wanted to use the available
info in the status file.


 \ /
  Last update: 2020-12-29 06:37    [W:0.035 / U:3.568 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site