From: Alexander Shishkin <alexander.shishkin@linux.intel.com>
To: tip-bot2 for Thomas Richter <tip-bot2@linutronix.de>,
linux-tip-commits@vger.kernel.org
Cc: Thomas Richter <tmricht@linux.ibm.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Jiri Olsa <jolsa@redhat.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Mark Rutland <mark.rutland@arm.com>,
Namhyung Kim <namhyung@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
acme@kernel.org, gor@linux.ibm.com, hechaol@fb.com,
heiko.carstens@de.ibm.com, linux-perf-users@vger.kernel.org,
songliubraving@fb.com, Ingo Molnar <mingo@kernel.org>,
Borislav Petkov <bp@alien8.de>,
linux-kernel@vger.kernel.org, alexander.shishkin@linux.intel.com
Subject: Re: [tip: perf/urgent] perf/aux: Fix tracking of auxiliary trace buffer allocation
Date: Fri, 15 Nov 2019 18:06:59 +0200 [thread overview]
Message-ID: <87bltddsyk.fsf@ashishki-desk.ger.corp.intel.com> (raw)
In-Reply-To: <157165050422.29376.10692255781840811810.tip-bot2@tip-bot2>
"tip-bot2 for Thomas Richter" <tip-bot2@linutronix.de> writes:
> /* now it's safe to free the pages */
> - atomic_long_sub(rb->aux_nr_pages, &mmap_user->locked_vm);
> - atomic64_sub(rb->aux_mmap_locked, &vma->vm_mm->pinned_vm);
> + if (!rb->aux_mmap_locked)
> + atomic_long_sub(rb->aux_nr_pages, &mmap_user->locked_vm);
> + else
> + atomic64_sub(rb->aux_mmap_locked, &vma->vm_mm->pinned_vm);
This only works correctly when rb->aux_mmap_locked is either equal to
rb->aux_nr_pages or zero. Otherwise, it leaks
rb->aux_nr_pages - rb->aux_mmap_locked
in the locked_vm permanently.
Regards,
--
Alex
prev parent reply other threads:[~2019-11-15 16:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-21 8:33 [PATCH] perf/core: " Thomas Richter
2019-10-21 9:35 ` [tip: perf/urgent] perf/aux: " tip-bot2 for Thomas Richter
2019-11-15 16:06 ` Alexander Shishkin [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=87bltddsyk.fsf@ashishki-desk.ger.corp.intel.com \
--to=alexander.shishkin@linux.intel.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=acme@redhat.com \
--cc=bp@alien8.de \
--cc=gor@linux.ibm.com \
--cc=hechaol@fb.com \
--cc=heiko.carstens@de.ibm.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=songliubraving@fb.com \
--cc=tglx@linutronix.de \
--cc=tip-bot2@linutronix.de \
--cc=tmricht@linux.ibm.com \
--cc=torvalds@linux-foundation.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
all inboxes | Powered by JetHome®