[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM9d7ci4YapWyRK-tujg0THmgK6Ys9jCE7NSPHX1pP3rN4rt+w@mail.gmail.com>
Date: Tue, 29 Dec 2020 14:35:07 +0900
From: Namhyung Kim <namhyung@...nel.org>
To: Jiri Olsa <jolsa@...hat.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
LKML <linux-kernel@...r.kernel.org>,
Stephane Eranian <eranian@...gle.com>,
Andi Kleen <ak@...ux.intel.com>,
Ian Rogers <irogers@...gle.com>
Subject: Re: [PATCH 2/3] perf tools: Skip MMAP record synthesis for kernel threads
On Mon, Dec 28, 2020 at 8:50 PM Jiri Olsa <jolsa@...hat.com> 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.
Thanks,
Namhyung
Powered by blists - more mailing lists