lkml.org 
[lkml]   [2019]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] perf: rework memory accounting in perf_mmap()
Date


> On Sep 16, 2019, at 1:10 PM, Hechao Li <hechaol@fb.com> wrote:
>
> Song Liu <songliubraving@fb.com> wrote on Mon [2019-Sep-16 12:43:16 -0700]:
>> 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
>
> The change looks good to me. Thanks, Song.
>
> Reviewed-By: Hechao Li <hechaol@fb.com>

Thanks Hechao!

Hi Peter,

Does this fix look good to you?

Thanks,
Song

\
 
 \ /
  Last update: 2019-09-30 07:34    [W:0.045 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site