Re: [PATCH] perf: rework memory accounting in perf_mmap()

2019-10-07 Thread Peter Zijlstra
On Mon, Oct 07, 2019 at 04:31:37PM +, Song Liu wrote: > Hi Peter, > > > On Sep 30, 2019, at 2:02 AM, Peter Zijlstra 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 "us

Re: [PATCH] perf: rework memory accounting in perf_mmap()

2019-10-07 Thread Song Liu
Hi Peter, > On Sep 30, 2019, at 2:02 AM, Peter Zijlstra 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: >> >>

Re: [PATCH] perf: rework memory accounting in perf_mmap()

2019-09-30 Thread Peter Zijlstra
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

Re: [PATCH] perf: rework memory accounting in perf_mmap()

2019-09-29 Thread Song Liu
> On Sep 16, 2019, at 1:10 PM, Hechao Li wrote: > > Song Liu wrote on Mon [2019-Sep-16 12:43:16 -0700]: >> Hi Peter, >> >>> On Sep 4, 2019, at 2:46 PM, Song Liu wrote: >>> >>> perf_mmap() always increases user->locked_vm. As a result, "extra" could >>> grow bigger than "user_extra", which

Re: [PATCH] perf: rework memory accounting in perf_mmap()

2019-09-16 Thread Hechao Li
Song Liu wrote on Mon [2019-Sep-16 12:43:16 -0700]: > Hi Peter, > > > On Sep 4, 2019, at 2:46 PM, 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: > > > > N

Re: [PATCH] perf: rework memory accounting in perf_mmap()

2019-09-16 Thread Song Liu
Hi Peter, > On Sep 4, 2019, at 2:46 PM, 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 |

[PATCH] perf: rework memory accounting in perf_mmap()

2019-09-04 Thread Song Liu
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