Re: [PATCH V3 3/5] mm: mlock: Introduce VM_LOCKONFAULT and add mlock flags to enable it

2015-07-21 Thread Vlastimil Babka
On 07/10/2015 06:19 PM, Eric B Munson wrote: On Fri, 10 Jul 2015, Jonathan Corbet wrote: On Thu, 9 Jul 2015 14:46:35 -0400 Eric B Munson wrote: One other question...if I call mlock2(MLOCK_ONFAULT) on a range that already has resident pages, I believe that those pages will not be locked until

Re: [PATCH V3 3/5] mm: mlock: Introduce VM_LOCKONFAULT and add mlock flags to enable it

2015-07-10 Thread Eric B Munson
On Fri, 10 Jul 2015, Jonathan Corbet wrote: > On Thu, 9 Jul 2015 14:46:35 -0400 > Eric B Munson wrote: > > > > One other question...if I call mlock2(MLOCK_ONFAULT) on a range that > > > already has resident pages, I believe that those pages will not be locked > > > until they are reclaimed and f

Re: [PATCH V3 3/5] mm: mlock: Introduce VM_LOCKONFAULT and add mlock flags to enable it

2015-07-10 Thread Jonathan Corbet
On Thu, 9 Jul 2015 14:46:35 -0400 Eric B Munson wrote: > > One other question...if I call mlock2(MLOCK_ONFAULT) on a range that > > already has resident pages, I believe that those pages will not be locked > > until they are reclaimed and faulted back in again, right? I suspect that > > could be

Re: [PATCH V3 3/5] mm: mlock: Introduce VM_LOCKONFAULT and add mlock flags to enable it

2015-07-09 Thread Eric B Munson
On Wed, 08 Jul 2015, Jonathan Corbet wrote: > On Wed, 8 Jul 2015 16:34:56 -0400 > Eric B Munson wrote: > > > > Quick, possibly dumb question: I've been beating my head against these for > > > a little bit, and I can't figure out what's supposed to happen in this > > > case: > > > > > > mlock2

Re: [PATCH V3 3/5] mm: mlock: Introduce VM_LOCKONFAULT and add mlock flags to enable it

2015-07-08 Thread Jonathan Corbet
On Wed, 8 Jul 2015 16:34:56 -0400 Eric B Munson wrote: > > Quick, possibly dumb question: I've been beating my head against these for > > a little bit, and I can't figure out what's supposed to happen in this > > case: > > > > mlock2(addr, len, MLOCK_ONFAULT); > > munlock2(addr, len, MLO

Re: [PATCH V3 3/5] mm: mlock: Introduce VM_LOCKONFAULT and add mlock flags to enable it

2015-07-08 Thread Eric B Munson
On Wed, 08 Jul 2015, Jonathan Corbet wrote: > On Tue, 7 Jul 2015 13:03:41 -0400 > Eric B Munson wrote: > > > This patch introduces the ability to request that pages are not > > pre-faulted, but are placed on the unevictable LRU when they are finally > > faulted in. This can be done area at a t

Re: [PATCH V3 3/5] mm: mlock: Introduce VM_LOCKONFAULT and add mlock flags to enable it

2015-07-08 Thread Jonathan Corbet
On Tue, 7 Jul 2015 13:03:41 -0400 Eric B Munson wrote: > This patch introduces the ability to request that pages are not > pre-faulted, but are placed on the unevictable LRU when they are finally > faulted in. This can be done area at a time via the > mlock2(MLOCK_ONFAULT) or the mlockall(MCL_O

[PATCH V3 3/5] mm: mlock: Introduce VM_LOCKONFAULT and add mlock flags to enable it

2015-07-07 Thread Eric B Munson
The cost of faulting in all memory to be locked can be very high when working with large mappings. If only portions of the mapping will be used this can incur a high penalty for locking. For the example of a large file, this is the usage pattern for a large statical language model (probably appli