public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Leo Yan <leo.yan@linaro.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	James Clark <james.clark@arm.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/2] perf kvm: Fix memory leak
Date: Mon, 20 Mar 2023 19:37:14 -0300	[thread overview]
Message-ID: <ZBjgGg3XumiJB/YG@kernel.org> (raw)
In-Reply-To: <CAP-5=fVBZfTrtp6OUzop3HxL-Aw80FDC+7MPS6UEwDhhfkgk_Q@mail.gmail.com>

Em Mon, Mar 20, 2023 at 10:43:11AM -0700, Ian Rogers escreveu:
> On Sun, Mar 19, 2023 at 11:16 PM Leo Yan <leo.yan@linaro.org> wrote:
> >
> > This patch seris is to address memory leak issues in perf kvm.
> >
> > The first patch introduces refcnt in structure kvm_info, so we can avoid
> > memory leak for it.
> >
> > The second patch explicitly delete histograms entries before program
> > exiting rather than relying on kernel releasing memory space.
> >
> 
> Series:
> Acked-by: Ian Rogers <irogers@google.com>

I applied this, but the second patch may end up delaying tool exit by
traversing data structures holding lots of objects to needless free
them.

There are places in perf where we do it conditionally for that reason.

At some point I want to try signalling we're exiting using some global
variable and then making all memory free operations become nops.

- Arnaldo


 
> Thanks,
> Ian
> 
> > Leo Yan (2):
> >   perf kvm: Support refcnt in structure kvm_info
> >   perf kvm: Delete histograms entries before exiting
> >
> >  tools/perf/builtin-kvm.c   |  6 ++++--
> >  tools/perf/util/hist.c     |  5 +++++
> >  tools/perf/util/kvm-stat.h | 37 +++++++++++++++++++++++++++++++++++++
> >  3 files changed, 46 insertions(+), 2 deletions(-)
> >
> > --
> > 2.39.2
> >

-- 

- Arnaldo

      reply	other threads:[~2023-03-20 22:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-20  6:16 [PATCH 0/2] perf kvm: Fix memory leak Leo Yan
2023-03-20  6:16 ` [PATCH 1/2] perf kvm: Support refcnt in structure kvm_info Leo Yan
2023-03-21 13:00   ` Arnaldo Carvalho de Melo
2023-03-21 14:22     ` Leo Yan
2023-03-21 17:48       ` Arnaldo Carvalho de Melo
2023-03-20  6:16 ` [PATCH 2/2] perf kvm: Delete histograms entries before exiting Leo Yan
2023-03-20 17:43 ` [PATCH 0/2] perf kvm: Fix memory leak Ian Rogers
2023-03-20 22:37   ` Arnaldo Carvalho de Melo [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=ZBjgGg3XumiJB/YG@kernel.org \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@arm.com \
    --cc=jolsa@kernel.org \
    --cc=leo.yan@linaro.org \
    --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 \
    /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