mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Song Liu <songliubraving@fb.com>
To: LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>
Cc: 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, 16 Sep 2019 19:43:16 +0000	[thread overview]
Message-ID: <D0AB9FA0-B99D-4BE4-82FF-E3098EFFB208@fb.com> (raw)
In-Reply-To: <20190904214618.3795672-1-songliubraving@fb.com>

Hi Peter,

> On Sep 4, 2019, at 2:46 PM, Song Liu <songliubraving@fb.com> 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.
> 
> Reported-by: Hechao Li <hechaol@fb.com>
> Cc: Jie Meng <jmeng@fb.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Signed-off-by: Song Liu <songliubraving@fb.com>

Could you please share your feedbacks/comments on this one?

Thanks,
Song

  reply	other threads:[~2019-09-16 19:44 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 [this message]
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
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=D0AB9FA0-B99D-4BE4-82FF-E3098EFFB208@fb.com \
    --to=songliubraving@fb.com \
    --cc=Kernel-team@fb.com \
    --cc=hechaol@fb.com \
    --cc=jmeng@fb.com \
    --cc=linux-kernel@vger.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

all inboxes | Powered by JetHome®