From: James Clark <james.clark@arm.com>
To: Ian Rogers <irogers@google.com>
Cc: "Steinar H . Gunderson" <sesse@google.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
Kan Liang <kan.liang@linux.intel.com>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 0/3] Fix and improve __maps__fixup_overlap_and_insert
Date: Thu, 6 Jun 2024 11:56:46 +0100 [thread overview]
Message-ID: <bc34d0aa-7152-4f0b-a3c4-11b1a63fba9b@arm.com> (raw)
In-Reply-To: <20240521165109.708593-1-irogers@google.com>
On 21/05/2024 17:51, Ian Rogers wrote:
> Fix latent unlikely bugs in __maps__fixup_overlap_and_insert.
>
> Improve __maps__fixup_overlap_and_insert's performance 21x in the case
> of overlapping mmaps. sesse@google.com reported slowness opening
> perf.data files from chromium where the files contained a large number
> of overlapping mappings. Improve this case primarily by avoiding
> unnecessary sorting.
>
> Unscientific timing data processing a perf.data file with overlapping
> mmap events from chromium:
>
> Before:
> real 0m9.856s
> user 0m9.637s
> sys 0m0.204s
>
> After:
> real 0m0.675s
> user 0m0.454s
> sys 0m0.196s
>
> Tested with address/leak sanitizer, invariant checks and validating
> the before and after output are identical.
>
> Ian Rogers (3):
> perf maps: Fix use after free in __maps__fixup_overlap_and_insert
> perf maps: Reduce sorting for overlapping mappings
> perf maps: Add/use a sorted insert for fixup overlap and insert
>
> tools/perf/util/maps.c | 113 +++++++++++++++++++++++++++++++++--------
> 1 file changed, 92 insertions(+), 21 deletions(-)
>
Reviewed-by: James Clark <james.clark@arm.com>
I'm wondering if there is any point in the non sorted insert any more?
Maps could be always either sorted by name or sorted by address and
insert() is always a sorted/fixup-overlaps insert depending on the sort
style of the list.
next prev parent reply other threads:[~2024-06-06 10:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-21 16:51 [PATCH v1 0/3] Fix and improve __maps__fixup_overlap_and_insert Ian Rogers
2024-05-21 16:51 ` [PATCH v1 1/3] perf maps: Fix use after free in __maps__fixup_overlap_and_insert Ian Rogers
2024-05-21 16:51 ` [PATCH v1 2/3] perf maps: Reduce sorting for overlapping mappings Ian Rogers
2024-05-21 16:51 ` [PATCH v1 3/3] perf maps: Add/use a sorted insert for fixup overlap and insert Ian Rogers
2024-06-05 23:54 ` [PATCH v1 0/3] Fix and improve __maps__fixup_overlap_and_insert Ian Rogers
2024-06-06 10:56 ` James Clark [this message]
2024-06-07 4:31 ` Ian Rogers
2024-06-07 17:51 ` Namhyung Kim
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=bc34d0aa-7152-4f0b-a3c4-11b1a63fba9b@arm.com \
--to=james.clark@arm.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=sesse@google.com \
/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).