mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@elte.hu>,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: Re: [PATCH] perf: Prevent buildid collection running forever
Date: Thu, 2 Dec 2010 23:32:17 +0100 (CET)	[thread overview]
Message-ID: <alpine.LFD.2.00.1012022323390.2653@localhost6.localdomain6> (raw)
In-Reply-To: <alpine.LFD.2.00.1012022208300.2653@localhost6.localdomain6>

On Thu, 2 Dec 2010, Thomas Gleixner wrote:

> Collecting the buildids after a long perf run can result in running
> forever.
> 
> The reason is that the perf_ops which buildids uses are not having the
> .comm function set. Sounds weird, but the way how perf fork/mmap
> handling works explains it:
> 
> On fork the new task in perf userspace inherits the registered memory
> maps of the parent. This is almost correct (it's ignoring
> MADV_DONTFORK) for threads and forks. For new processes the extra
> "comm" event is generated which then removes the parent mappings from
> the child. The buildid code ignores the comm event and therefor the
> parents mappings are kept. When tracing e.g. a kernel compile then the
> inherited process chain can be pretty long and every child gets the
> old and partially replaced mappings of the various ancestors, which
> leads to an endless shuffling in map_groups__fixup_overlappings()
> 
> Add the default comm event for now to "fix" this.

<REMOVE THIS>

> The real fix is to transport this information at clone/fork time with
> the event, which is easy as the kernel knows it already. That would
> avoid that whole inherit/clone/remove heuristics in the postprocessing
> tools.

</REMOVE THIS>

Gah. I confused myself. Grr. commit 4385d580f2 explains the magic, but
we really should have done the explicit PERF_RECORD_EXEC or at least
made the .comm thing mandatory.

It's so fricking non obvious that the map flush happens in
thread__set_comm(). 

Yours grumpy

      tglx

      reply	other threads:[~2010-12-02 22:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-02 21:12 Thomas Gleixner
2010-12-02 22:32 ` Thomas Gleixner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.00.1012022323390.2653@localhost6.localdomain6 \
    --to=tglx@linutronix.de \
    --cc=acme@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®