From: Jiri Olsa <jolsa@redhat.com>
To: Jiri Olsa <jolsa@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
lkml <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Michael Petlan <mpetlan@redhat.com>,
Andi Kleen <ak@linux.intel.com>,
Stephane Eranian <eranian@google.com>,
Jin Yao <yao.jin@linux.intel.com>,
Alexey Budankov <alexey.budankov@linux.intel.com>
Subject: Re: [PATCHv2 0/2] perf tools: Share struct map after clone
Date: Wed, 23 Oct 2019 09:55:17 +0200 [thread overview]
Message-ID: <20191023075517.GA22919@krava> (raw)
In-Reply-To: <20191016082226.10325-1-jolsa@kernel.org>
On Wed, Oct 16, 2019 at 10:22:24AM +0200, Jiri Olsa wrote:
> hi,
> Andi reported that maps cloning is eating lot of memory and
> it's probably unnecessary, because they keep the same data.
>
> This 'maps sharing' seems to save lot of heap for reports with
> many forks/cloned mmaps (over 60% in example below).
>
> Profile kernel build:
>
> $ perf record make -j 40
>
> Get heap profile (tools/perf directory):
>
> $ <install gperftools>
> $ make TCMALLOC=1
> $ HEAPPROFILE=/tmp/heapprof ./perf report -i perf.data --stdio > out
> $ pprof ./perf /tmp/heapprof.000*
>
> Before:
>
> (pprof) top
> Total: 2335.5 MB
> 1735.1 74.3% 74.3% 1735.1 74.3% memdup
> 402.0 17.2% 91.5% 402.0 17.2% zalloc
> 140.2 6.0% 97.5% 145.8 6.2% map__new
> 33.6 1.4% 98.9% 33.6 1.4% symbol__new
> 12.4 0.5% 99.5% 12.4 0.5% alloc_event
> 6.2 0.3% 99.7% 6.2 0.3% nsinfo__new
> 5.5 0.2% 100.0% 5.5 0.2% nsinfo__copy
> 0.3 0.0% 100.0% 0.3 0.0% dso__new
> 0.1 0.0% 100.0% 0.1 0.0% do_read_string
> 0.0 0.0% 100.0% 0.0 0.0% __GI__IO_file_doallocate
>
> After:
>
> (pprof) top
> Total: 784.5 MB
> 385.8 49.2% 49.2% 385.8 49.2% memdup
> 285.8 36.4% 85.6% 285.8 36.4% zalloc
> 80.4 10.3% 95.9% 83.7 10.7% map__new
> 19.1 2.4% 98.3% 19.1 2.4% symbol__new
> 6.2 0.8% 99.1% 6.2 0.8% alloc_event
> 3.6 0.5% 99.6% 3.6 0.5% nsinfo__new
> 3.2 0.4% 100.0% 3.2 0.4% nsinfo__copy
> 0.2 0.0% 100.0% 0.2 0.0% dso__new
> 0.0 0.0% 100.0% 0.0 0.0% do_read_string
> 0.0 0.0% 100.0% 0.0 0.0% elf_fill
>
> v2 changes:
> - rebased to Arnaldo's perf/core
> - patch 1 already taken
>
> Also available in here:
> git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
> perf/map_shared
I rebased to latest perf/core and pushed the branch out
jirka
next prev parent reply other threads:[~2019-10-23 7:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-16 8:22 [PATCHv2 0/2] perf tools: Share struct map after clone Jiri Olsa
2019-10-16 8:22 ` [PATCH 1/2] perf tools: Separate shareable part of 'struct map' into 'struct map_shared' Jiri Olsa
2019-10-16 8:22 ` [PATCH 2/2] perf tools: Make 'struct map_shared' truly shared Jiri Olsa
2019-10-23 7:55 ` Jiri Olsa [this message]
2019-10-29 20:58 ` [PATCHv2 0/2] perf tools: Share struct map after clone Jiri Olsa
2019-11-18 12:14 ` Jiri Olsa
2019-11-18 21:48 ` Arnaldo Carvalho de Melo
2019-11-19 11:06 ` Jiri Olsa
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=20191023075517.GA22919@krava \
--to=jolsa@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=alexey.budankov@linux.intel.com \
--cc=eranian@google.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mpetlan@redhat.com \
--cc=namhyung@kernel.org \
--cc=yao.jin@linux.intel.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