lkml.org 
[lkml]   [2019]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf: rework memory accounting in perf_mmap()
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.

\
 
 \ /
  Last update: 2019-10-07 18:56    [W:0.044 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site