linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Stephane Eranian <eranian@google.com>
Cc: "Liang, Kan" <kan.liang@linux.intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Borislav Petkov <bp@alien8.de>, Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH 1/2] perf: Add munmap callback
Date: Thu, 25 Oct 2018 02:23:12 +0200	[thread overview]
Message-ID: <20181025002312.GS3109@worktop.c.hoisthospitality.com> (raw)
In-Reply-To: <CABPqkBQEp9SLQuAonW7-c9HzH4bSgUyJGJ5ZZNXHy-0phHvvZQ@mail.gmail.com>

On Wed, Oct 24, 2018 at 12:30:52PM -0700, Stephane Eranian wrote:
> Hi,
> 
> On Wed, Oct 24, 2018 at 8:12 AM <kan.liang@linux.intel.com> wrote:
> >
> > From: Kan Liang <kan.liang@linux.intel.com>
> >
> > To calculate the physical address, perf needs to walk the pages tables.
> > The related mapping may has already been removed from pages table in
> > some cases (e.g. large PEBS). The virtual address recorded in the first
> > PEBS records may already be unmapped before draining PEBS buffers.
> >
> > Add a munmap callback to notify the PMU of any unmapping, which only be
> > invoked when the munmap is implemented.
> >
> The need for this new record type extends beyond physical address conversions
> and PEBS. A long while ago, someone reported issues with symbolization related
> to perf lacking munmap tracking. It had to do with vma merging. I think the
> sequence of mmaps was as follows in the problematic case:
> 1.   addr1 = mmap(8192);
> 2.   munmap(addr1 + 4096, 4096)
> 3.   addr2 = mmap(addr1+4096, 4096)
> 
> If successful, that yields addr2 = addr1 + 4096 (could also get the
> same without forcing the address).

That is actually a different problem. And you're right, we never did fix
that.

I agree with you that Kan's Changelog is somewhat cryptic; it took me at
least 3 times reading and looking at what the patches actually do to
understand :/

  reply	other threads:[~2018-10-25  0:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-24 15:11 [PATCH 1/2] perf: Add munmap callback kan.liang
2018-10-24 15:11 ` [PATCH 2/2] perf/x86/intel: Fix missing physical address in large PEBS kan.liang
2018-10-24 16:23 ` [PATCH 1/2] perf: Add munmap callback Andi Kleen
2018-10-24 16:32   ` Arnaldo Carvalho de Melo
2018-10-24 18:12     ` Liang, Kan
2018-10-24 18:28       ` Andi Kleen
2018-10-25  0:31         ` Peter Zijlstra
2018-10-24 19:15       ` Arnaldo Carvalho de Melo
2018-10-24 19:30 ` Stephane Eranian
2018-10-25  0:23   ` Peter Zijlstra [this message]
2018-10-25  0:25     ` Stephane Eranian
2018-10-25  0:34       ` Peter Zijlstra
2018-10-25  0:44         ` Stephane Eranian
2018-11-01 14:09   ` Liang, Kan
2018-11-05 10:59     ` Stephane Eranian
2018-11-05 15:43       ` Liang, Kan
2018-11-06 15:00         ` Stephane Eranian
2018-11-06 16:47           ` Liang, Kan
2018-10-25  0:29 ` Peter Zijlstra
2018-10-25 14:00   ` Liang, Kan
2018-10-30 12:51     ` Peter Zijlstra

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=20181025002312.GS3109@worktop.c.hoisthospitality.com \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=eranian@google.com \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).