linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/3] Fix and improve __maps__fixup_overlap_and_insert
@ 2024-05-21 16:51 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
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Ian Rogers @ 2024-05-21 16:51 UTC (permalink / raw)
  To: Steinar H . Gunderson, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
	Kan Liang, linux-perf-users, linux-kernel

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(-)

-- 
2.45.0.rc1.225.g2a3ae87e7f-goog


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-06-07 17:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2024-06-07  4:31   ` Ian Rogers
2024-06-07 17:51 ` Namhyung Kim

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).