From: Peter Zijlstra <peterz@infradead.org>
To: Song Liu <songliubraving@fb.com>
Cc: open list <linux-kernel@vger.kernel.org>,
Kernel Team <Kernel-team@fb.com>, Jie Meng <jmeng@fb.com>,
Hechao Li <hechaol@fb.com>
Subject: Re: [PATCH] perf: rework memory accounting in perf_mmap()
Date: Mon, 7 Oct 2019 18:56:18 +0200 [thread overview]
Message-ID: <20191007165618.GJ4643@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <B97C6326-7CA2-4F57-A259-F5FB152E14D1@fb.com>
On Mon, Oct 07, 2019 at 04:31:37PM +0000, Song Liu wrote:
> Hi Peter,
>
> > On Sep 30, 2019, at 2:02 AM, Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > On Wed, Sep 04, 2019 at 02:46:18PM -0700, Song Liu wrote:
> >> perf_mmap() always increases user->locked_vm. As a result, "extra" could
> >> grow bigger than "user_extra", which doesn't make sense. Here is an
> >> example case:
> >>
> >> Note: Assume "user_lock_limit" is very small.
> >> | # of perf_mmap calls |vma->vm_mm->pinned_vm|user->locked_vm|
> >> | 0 | 0 | 0 |
> >> | 1 | user_extra | user_extra |
> >> | 2 | 3 * user_extra | 2 * user_extra|
> >> | 3 | 6 * user_extra | 3 * user_extra|
> >> | 4 | 10 * user_extra | 4 * user_extra|
> >>
> >> Fix this by maintaining proper user_extra and extra.
> >
> > Aah, indeed.
>
> Thanks for the feedback!
>
> >
> > Also, this code is unreadable (which is mostly my own fault I suppose)
> > :/
>
> How does this patch look to you? Is it ready to merge?
Yes, I queued it, I'll get it into tip soon. It got held up due to me
working on some other patches, sorry about that.
next prev parent reply other threads:[~2019-10-07 16:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-04 21:46 Song Liu
2019-09-16 19:43 ` Song Liu
2019-09-16 20:10 ` Hechao Li
2019-09-30 5:33 ` Song Liu
2019-09-30 9:02 ` Peter Zijlstra
2019-10-07 16:31 ` Song Liu
2019-10-07 16:56 ` Peter Zijlstra [this message]
2019-10-09 12:59 ` [tip: perf/urgent] perf/core: Rework " tip-bot2 for Song Liu
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=20191007165618.GJ4643@worktop.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=Kernel-team@fb.com \
--cc=hechaol@fb.com \
--cc=jmeng@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=songliubraving@fb.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
Powered by JetHome