lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 29 Dec 2020 14:35:07 +0900
From:   Namhyung Kim <>
To:     Jiri Olsa <>
Cc:     Arnaldo Carvalho de Melo <>,
        Ingo Molnar <>,
        Peter Zijlstra <>,
        Mark Rutland <>,
        Alexander Shishkin <>,
        LKML <>,
        Stephane Eranian <>,
        Andi Kleen <>,
        Ian Rogers <>
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 <> 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.


Powered by blists - more mailing lists