[PATCH v4] mlock.2: mlock2.2: Add entry to for new mlock2 syscall

2015-11-09 Thread Eric B Munson
Update the mlock.2 man page with information on mlock2() and the new mlockall() flag MCL_ONFAULT. Signed-off-by: Eric B Munson Acked-by: Michal Hocko Acked-by: Vlastimil Babka Cc: Michal Hocko Cc: Vlastimil Babka Cc: Jonathan Corbet Cc: linux-...@vger.kernel.org Cc: linux...@kvack.org Cc

Re: [PATCH 0/2] selftests/mlock2: Build warning fixes on Debian/m68k 4.0

2015-11-09 Thread Eric B Munson
On Mon, 09 Nov 2015, Eric B Munson wrote: > On Mon, 09 Nov 2015, Geert Uytterhoeven wrote: > > > Hi, > > > > The following 2 patches are needed to fix build warnings on Debian/m68k > > 4.0. > > > > However, after wiring up the mlock2 syscall, the

Re: [PATCH 1/2] selftests/mlock2: Add missing #define _GNU_SOURCE

2015-11-09 Thread Eric B Munson
needs _GNU_SOURCE before glibc > 2.10. > > Signed-off-by: Geert Uytterhoeven Acked-by: Eric B Munson > --- > tools/testing/selftests/vm/mlock2-tests.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/tools/testing/selftests/vm/mlock2-tests.c > b/tools/testing/selft

Re: [PATCH 2/2] selftests/mlock2: Add ULL prefix to 64-bit constants

2015-11-09 Thread Eric B Munson
: integer constant is too large for 'long' type > mlock2-tests.c: In function 'unlock_onfault_check': > mlock2-tests.c:443: warning: integer constant is too large for 'long' type > mlock2-tests.c: In function 'test_lock_onfault_of_present': > mlo

Re: [PATCH 0/2] selftests/mlock2: Build warning fixes on Debian/m68k 4.0

2015-11-09 Thread Eric B Munson
On Mon, 09 Nov 2015, Geert Uytterhoeven wrote: > Hi, > > The following 2 patches are needed to fix build warnings on Debian/m68k > 4.0. > > However, after wiring up the mlock2 syscall, the test fails with: > > # ./mlock2-tests > fread kpageflags: Success > # > > as the fread() call retu

Re: [PATCH v2] mlock.2: mlock2.2: Add entry to for new mlock2 syscall

2015-09-11 Thread Eric B Munson
On Thu, 10 Sep 2015, Vlastimil Babka wrote: > On 08/31/2015 04:20 PM, Eric B Munson wrote: > > Update the mlock.2 man page with information on mlock2() and the new > > mlockall() flag MCL_ONFAULT. > > > > Signed-off-by: Eric B Munson > > Acked-by: Michal Hock

[PATCH v3] mlock.2: mlock2.2: Add entry to for new mlock2 syscall

2015-09-11 Thread Eric B Munson
Update the mlock.2 man page with information on mlock2() and the new mlockall() flag MCL_ONFAULT. Signed-off-by: Eric B Munson Acked-by: Michal Hocko Acked-by: Vlastimil Babka Cc: Michal Hocko Cc: Vlastimil Babka Cc: Jonathan Corbet Cc: linux-...@vger.kernel.org Cc: linux...@kvack.org Cc

[PATCH v9 3/6] mm: Introduce VM_LOCKONFAULT

2015-09-08 Thread Eric B Munson
to communicate the locked state of a VMA. FOLL_POPULATE will now only control if the VMA should be populated and in the case of VM_LOCKONFAULT, it will not be set. Signed-off-by: Eric B Munson Acked-by: Michal Hocko Acked-by: Vlastimil Babka Cc: Michal Hocko Cc: Vlastimil Babka Cc: Jonathan

[PATCH v9 5/6] selftests: vm: Add tests for lock on fault

2015-09-08 Thread Eric B Munson
that the limit test needs to be run a normal user. Also add tests to use the new mlock2 family of system calls. Signed-off-by: Eric B Munson Cc: Thierry Reding Cc: Shuah Khan Cc: Michal Hocko Cc: Vlastimil Babka Cc: Jonathan Corbet Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org Cc

[PATCH v9 0/6] Allow user to request memory to be locked on page fault

2015-09-08 Thread Eric B Munson
ssing MAP_LOCKONFAULT for tile Changes from V2: Added new system calls for mlock, munlock, and munlockall with added flags arguments for controlling how memory is locked or unlocked. Eric B Munson (6): mm: mlock: Refactor mlock, munlock, and munlockall code mm: mlock: Add new mlock system call mm: Intr

[PATCH v9 2/6] mm: mlock: Add new mlock system call

2015-09-08 Thread Eric B Munson
With the refactored mlock code, introduce a new system call for mlock. The new call will allow the user to specify what lock states are being added. mlock2 is trivial at the moment, but a follow on patch will add a new mlock state making it useful. Signed-off-by: Eric B Munson Acked-by

[PATCH v9 6/6] mips: Add entry for new mlock2 syscall

2015-09-08 Thread Eric B Munson
A previous commit introduced the new mlock2 syscall, add entries for the MIPS architecture. Signed-off-by: Eric B Munson Acked-by: Ralf Baechle Cc: Ralf Baechle Cc: linux-m...@linux-mips.org Cc: linux-...@vger.kernel.org Cc: linux-a...@vger.kernel.org Cc: linux...@kvack.org Cc: linux-kernel

[PATCH v9 4/6] mm: mlock: Add mlock flags to enable VM_LOCKONFAULT usage

2015-09-08 Thread Eric B Munson
nlock() will unconditionally clear both vma flags. munlockall() unconditionally clears for VMA flags on all VMAs and in the mm->def_flags field. Signed-off-by: Eric B Munson Acked-by: Vlastimil Babka Acked-by: Michal Hocko Cc: Michal Hocko Cc: Vlastimil Babka Cc: Jonathan Corbet Cc: "Kir

[PATCH v9 1/6] mm: mlock: Refactor mlock, munlock, and munlockall code

2015-09-08 Thread Eric B Munson
code needs some reorganization so that all the actual entry point handles is checking input and translating to VMA flags. Signed-off-by: Eric B Munson Acked-by: Kirill A. Shutemov Acked-by: Vlastimil Babka Acked-by: Michal Hocko Cc: Michal Hocko Cc: Vlastimil Babka Cc: "Kirill A. Shu

Re: [PATCH v8 3/6] mm: Introduce VM_LOCKONFAULT

2015-09-01 Thread Eric B Munson
On August 28, 2015 10:18:30 AM EDT, Michal Hocko wrote: > >Why do we need to export this? Neither of the consumers care and should >care. VM_LOCKONFAULT should never be set without VM_LOCKED which is the >only thing that we should care about. I am out of the office and I don't know if I will b

[PATCH v2] mlock.2: mlock2.2: Add entry to for new mlock2 syscall

2015-08-31 Thread Eric B Munson
Update the mlock.2 man page with information on mlock2() and the new mlockall() flag MCL_ONFAULT. Signed-off-by: Eric B Munson Acked-by: Michal Hocko Cc: Michal Hocko Cc: Vlastimil Babka Cc: Jonathan Corbet Cc: linux-...@vger.kernel.org Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org

Re: [PATCH v8 3/6] mm: Introduce VM_LOCKONFAULT

2015-08-28 Thread Eric B Munson
On Fri, 28 Aug 2015, Michal Hocko wrote: > On Wed 26-08-15 14:24:22, Eric B Munson wrote: > > 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 hig

Re: [PATCH] mlock.2: mlock2.2: Add entry to for new mlock2 syscall

2015-08-28 Thread Eric B Munson
On Fri, 28 Aug 2015, Eric B Munson wrote: > Update the mlock.2 man page with information on mlock2() and the new > mlockall() flag MCL_ONFAULT. > > Signed-off-by: Eric B Munson > Cc: Michal Hocko > Cc: Vlastimil Babka > Cc: Jonathan Corbet > Cc: linux-...@vge

[PATCH] mlock.2: mlock2.2: Add entry to for new mlock2 syscall

2015-08-28 Thread Eric B Munson
Update the mlock.2 man page with information on mlock2() and the new mlockall() flag MCL_ONFAULT. Signed-off-by: Eric B Munson Cc: Michal Hocko Cc: Vlastimil Babka Cc: Jonathan Corbet Cc: linux-...@vger.kernel.org Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org --- man2/mlock.2

[PATCH] mremap.2: Add note about mremap with locked areas

2015-08-28 Thread Eric B Munson
should be noted. Signed-off-by: Eric B Munson Cc: Michal Hocko Cc: David Rientjes Cc: linux-...@vger.kernel.org Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org --- man2/mremap.2 | 11 +++ 1 file changed, 11 insertions(+) diff --git a/man2/mremap.2 b/man2/mremap.2 index 071adb5

[PATCH v8 6/6] mips: Add entry for new mlock2 syscall

2015-08-26 Thread Eric B Munson
A previous commit introduced the new mlock2 syscall, add entries for the MIPS architecture. Signed-off-by: Eric B Munson Acked-by: Ralf Baechle Cc: Ralf Baechle Cc: linux-m...@linux-mips.org Cc: linux-...@vger.kernel.org Cc: linux-a...@vger.kernel.org Cc: linux...@kvack.org Cc: linux-kernel

[PATCH v8 5/6] selftests: vm: Add tests for lock on fault

2015-08-26 Thread Eric B Munson
that the limit test needs to be run a normal user. Also add tests to use the new mlock2 family of system calls. Signed-off-by: Eric B Munson Cc: Thierry Reding Cc: Shuah Khan Cc: Michal Hocko Cc: Vlastimil Babka Cc: Jonathan Corbet Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org Cc

[PATCH v8 3/6] mm: Introduce VM_LOCKONFAULT

2015-08-26 Thread Eric B Munson
to communicate the locked state of a VMA. FOLL_POPULATE will now only control if the VMA should be populated and in the case of VM_LOCKONFAULT, it will not be set. Signed-off-by: Eric B Munson Cc: Michal Hocko Cc: Vlastimil Babka Cc: Jonathan Corbet Cc: "Kirill A. Shutemov" Cc: li

[PATCH v8 4/6] mm: mlock: Add mlock flags to enable VM_LOCKONFAULT usage

2015-08-26 Thread Eric B Munson
nlock() will unconditionally clear both vma flags. munlockall() unconditionally clears for VMA flags on all VMAs and in the mm->def_flags field. Signed-off-by: Eric B Munson Acked-by: Vlastimil Babka Cc: Michal Hocko Cc: Vlastimil Babka Cc: Jonathan Corbet Cc: "Kirill A. Shutemov" Cc: li

[PATCH v8 0/6] Allow user to request memory to be locked on page fault

2015-08-26 Thread Eric B Munson
syscall entries, fix NR_syscalls on multiple arch's Add missing MAP_LOCKONFAULT for tile Changes from V2: Added new system calls for mlock, munlock, and munlockall with added flags arguments for controlling how memory is locked or unlocked. Eric B Munson (6): mm: mlock: Refactor mlock, mu

[PATCH v8 2/6] mm: mlock: Add new mlock system call

2015-08-26 Thread Eric B Munson
With the refactored mlock code, introduce a new system call for mlock. The new call will allow the user to specify what lock states are being added. mlock2 is trivial at the moment, but a follow on patch will add a new mlock state making it useful. Signed-off-by: Eric B Munson Acked-by

[PATCH v8 1/6] mm: mlock: Refactor mlock, munlock, and munlockall code

2015-08-26 Thread Eric B Munson
code needs some reorganization so that all the actual entry point handles is checking input and translating to VMA flags. Signed-off-by: Eric B Munson Acked-by: Kirill A. Shutemov Acked-by: Vlastimil Babka Acked-by: Michal Hocko Cc: Michal Hocko Cc: Vlastimil Babka Cc: "Kirill A. Shu

Re: [PATCH v7 3/6] mm: Introduce VM_LOCKONFAULT

2015-08-25 Thread Eric B Munson
On Tue, 25 Aug 2015, Michal Hocko wrote: > On Tue 25-08-15 10:29:02, Eric B Munson wrote: > > On Tue, 25 Aug 2015, Michal Hocko wrote: > [...] > > > Considering the current behavior I do not thing it would be terrible > > > thing to do what Konstantin was suggest

Re: [PATCH v7 3/6] mm: Introduce VM_LOCKONFAULT

2015-08-25 Thread Eric B Munson
On Tue, 25 Aug 2015, Michal Hocko wrote: > On Fri 21-08-15 14:31:32, Eric B Munson wrote: > [...] > > I am in the middle of implementing lock on fault this way, but I cannot > > see how we will hanlde mremap of a lock on fault region. Say we have > > the following: >

Re: [PATCH v7 3/6] mm: Introduce VM_LOCKONFAULT

2015-08-24 Thread Eric B Munson
On Mon, 24 Aug 2015, Konstantin Khlebnikov wrote: > On Mon, Aug 24, 2015 at 8:00 PM, Eric B Munson wrote: > > On Mon, 24 Aug 2015, Konstantin Khlebnikov wrote: > > > >> On Mon, Aug 24, 2015 at 6:55 PM, Eric B Munson wrote: > >> > On Mon, 24 A

Re: [PATCH v7 3/6] mm: Introduce VM_LOCKONFAULT

2015-08-24 Thread Eric B Munson
On Mon, 24 Aug 2015, Konstantin Khlebnikov wrote: > On Mon, Aug 24, 2015 at 6:55 PM, Eric B Munson wrote: > > On Mon, 24 Aug 2015, Konstantin Khlebnikov wrote: > > > >> On Mon, Aug 24, 2015 at 6:09 PM, Eric B Munson wrote: > >> > On Mon, 24 Aug 2015, Vlastim

Re: [PATCH v7 3/6] mm: Introduce VM_LOCKONFAULT

2015-08-24 Thread Eric B Munson
On Mon, 24 Aug 2015, Konstantin Khlebnikov wrote: > On Mon, Aug 24, 2015 at 6:09 PM, Eric B Munson wrote: > > On Mon, 24 Aug 2015, Vlastimil Babka wrote: > > > >> On 08/24/2015 03:50 PM, Konstantin Khlebnikov wrote: > >> >On Mon, Aug 24, 2015 at 4:30 PM, Vla

Re: [PATCH v7 3/6] mm: Introduce VM_LOCKONFAULT

2015-08-24 Thread Eric B Munson
On Mon, 24 Aug 2015, Vlastimil Babka wrote: > On 08/24/2015 03:50 PM, Konstantin Khlebnikov wrote: > >On Mon, Aug 24, 2015 at 4:30 PM, Vlastimil Babka wrote: > >>On 08/24/2015 12:17 PM, Konstantin Khlebnikov wrote: > > > I am in the middle of implementing lock on fault this way, but

Re: [PATCH v7 3/6] mm: Introduce VM_LOCKONFAULT

2015-08-21 Thread Eric B Munson
On Fri, 21 Aug 2015, Michal Hocko wrote: > On Thu 20-08-15 13:03:09, Eric B Munson wrote: > > On Thu, 20 Aug 2015, Michal Hocko wrote: > > > > > On Wed 19-08-15 17:33:45, Eric B Munson wrote: > > > [...] > > > > The group which asked for this feature

Re: [PATCH v7 3/6] mm: Introduce VM_LOCKONFAULT

2015-08-20 Thread Eric B Munson
On Thu, 20 Aug 2015, Michal Hocko wrote: > On Wed 19-08-15 17:33:45, Eric B Munson wrote: > [...] > > The group which asked for this feature here > > wants the ability to distinguish between LOCKED and LOCKONFAULT regions > > and without the VMA flag there isn't a w

Re: [PATCH v7 3/6] mm: Introduce VM_LOCKONFAULT

2015-08-19 Thread Eric B Munson
On Wed, 12 Aug 2015, Michal Hocko wrote: > On Sun 09-08-15 01:22:53, Eric B Munson wrote: > > 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 hig

[PATCH v7 1/6] mm: mlock: Refactor mlock, munlock, and munlockall code

2015-08-08 Thread Eric B Munson
code needs some reorganization so that all the actual entry point handles is checking input and translating to VMA flags. Signed-off-by: Eric B Munson Acked-by: Kirill A. Shutemov Acked-by: Vlastimil Babka Cc: Michal Hocko Cc: Vlastimil Babka Cc: "Kirill A. Shutemov" Cc: linux...@kv

[PATCH v7 4/6] mm: mlock: Add mlock flags to enable VM_LOCKONFAULT usage

2015-08-08 Thread Eric B Munson
nlock() will unconditionally clear both vma flags. munlockall() unconditionally clears for VMA flags on all VMAs and in the mm->def_flags field. Signed-off-by: Eric B Munson Acked-by: Vlastimil Babka Cc: Michal Hocko Cc: Vlastimil Babka Cc: Jonathan Corbet Cc: "Kirill A. Shutemov" Cc: li

[PATCH v7 0/6] Allow user to request memory to be locked on page fault

2015-08-08 Thread Eric B Munson
from V2: Added new system calls for mlock, munlock, and munlockall with added flags arguments for controlling how memory is locked or unlocked. Eric B Munson (6): mm: mlock: Refactor mlock, munlock, and munlockall code mm: mlock: Add new mlock system call mm: Introduce VM_LOCKONFAULT mm:

[PATCH v7 3/6] mm: Introduce VM_LOCKONFAULT

2015-08-08 Thread Eric B Munson
to communicate the locked state of a VMA. FOLL_POPULATE will now only control if the VMA should be populated and in the case of VM_LOCKONFAULT, it will not be set. Signed-off-by: Eric B Munson Acked-by: Kirill A. Shutemov Cc: Michal Hocko Cc: Vlastimil Babka Cc: Jonathan Corbet Cc: "Kir

[PATCH v7 5/6] selftests: vm: Add tests for lock on fault

2015-08-08 Thread Eric B Munson
that the limit test needs to be run a normal user. Also add tests to use the new mlock2 family of system calls. Signed-off-by: Eric B Munson Cc: Shuah Khan Cc: Michal Hocko Cc: Vlastimil Babka Cc: Jonathan Corbet Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org Cc: linux

[PATCH v7 6/6] mips: Add entry for new mlock2 syscall

2015-08-08 Thread Eric B Munson
A previous commit introduced the new mlock2 syscall, add entries for the MIPS architecture. Signed-off-by: Eric B Munson Acked-by: Ralf Baechle Cc: Ralf Baechle Cc: linux-m...@linux-mips.org Cc: linux-...@vger.kernel.org Cc: linux-a...@vger.kernel.org Cc: linux...@kvack.org Cc: linux-kernel

[PATCH v7 2/6] mm: mlock: Add new mlock system call

2015-08-08 Thread Eric B Munson
With the refactored mlock code, introduce a new system call for mlock. The new call will allow the user to specify what lock states are being added. mlock2 is trivial at the moment, but a follow on patch will add a new mlock state making it useful. Signed-off-by: Eric B Munson Acked-by

Re: [PATCH V6 3/6] mm: Introduce VM_LOCKONFAULT

2015-08-07 Thread Eric B Munson
On Thu, 06 Aug 2015, Vlastimil Babka wrote: ... > > > >diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c > >index ca1e091..38d69fc 100644 > >--- a/fs/proc/task_mmu.c > >+++ b/fs/proc/task_mmu.c > >@@ -579,6 +579,7 @@ static void show_smap_vma_flags(struct seq_file *m, > >struct vm_area_struct

[PATCH V6 0/6] Allow user to request memory to be locked on page fault

2015-07-29 Thread Eric B Munson
multiple arch's Add missing MAP_LOCKONFAULT for tile Changes from V2: Added new system calls for mlock, munlock, and munlockall with added flags arguments for controlling how memory is locked or unlocked. Eric B Munson (6): mm: mlock: Refactor mlock, munlock, and munlockall code mm:

[PATCH V6 1/6] mm: mlock: Refactor mlock, munlock, and munlockall code

2015-07-29 Thread Eric B Munson
code needs some reorganization so that all the actual entry point handles is checking input and translating to VMA flags. Signed-off-by: Eric B Munson Acked-by: Kirill A. Shutemov Cc: Michal Hocko Cc: Vlastimil Babka Cc: "Kirill A. Shutemov" Cc: linux...@kvack.org Cc: li

[PATCH V6 3/6] mm: Introduce VM_LOCKONFAULT

2015-07-29 Thread Eric B Munson
to communicate the locked state of a VMA. FOLL_POPULATE will now only control if the VMA should be populated and in the case of VM_LOCKONFAULT, it will not be set. Signed-off-by: Eric B Munson Acked-by: Kirill A. Shutemov Cc: Michal Hocko Cc: Vlastimil Babka Cc: Jonathan Corbet Cc: "Kir

[PATCH V6 4/6] mm: mlock: Add mlock flags to enable VM_LOCKONFAULT usage

2015-07-29 Thread Eric B Munson
nlock() will unconditionally clear both vma flags. munlockall() unconditionally clears for VMA flags on all VMAs and in the mm->def_flags field. Signed-off-by: Eric B Munson Cc: Michal Hocko Cc: Vlastimil Babka Cc: Jonathan Corbet Cc: "Kirill A. Shutemov" Cc: linux-al...@vger.ke

[PATCH V6 2/6] mm: mlock: Add new mlock system call

2015-07-29 Thread Eric B Munson
With the refactored mlock code, introduce a new system call for mlock. The new call will allow the user to specify what lock states are being added. mlock2 is trivial at the moment, but a follow on patch will add a new mlock state making it useful. Signed-off-by: Eric B Munson Cc: Michal Hocko

[PATCH V6 6/6] mips: Add entry for new mlock2 syscall

2015-07-29 Thread Eric B Munson
A previous commit introduced the new mlock2 syscall, add entries for the MIPS architecture. Signed-off-by: Eric B Munson Cc: Ralf Baechle Cc: linux-m...@linux-mips.org Cc: linux-...@vger.kernel.org Cc: linux-a...@vger.kernel.org Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org --- arch

[PATCH V6 5/6] selftests: vm: Add tests for lock on fault

2015-07-29 Thread Eric B Munson
. Note that the limit test needs to be run a normal user. Also add tests to use the new mlock2 family of system calls. Signed-off-by: Eric B Munson Cc: Shuah Khan Cc: Michal Hocko Cc: Vlastimil Babka Cc: Jonathan Corbet Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org Cc: linux

Re: [PATCH V5 0/7] Allow user to request memory to be locked on page fault

2015-07-28 Thread Eric B Munson
On Tue, 28 Jul 2015, Vlastimil Babka wrote: > On 07/28/2015 03:49 PM, Eric B Munson wrote: > >On Tue, 28 Jul 2015, Michal Hocko wrote: > > > > [...] > > >The only > >remaining question I have is should we have 2 new mlockall flags so that > >the calle

Re: [PATCH RFC 1/1] Documentation: describe how to add a system call

2015-07-28 Thread Eric B Munson
ale > Reviewed-by: Michael Kerrisk This is really helpful Reviewed-by: Eric B Munson signature.asc Description: Digital signature

Re: [PATCH V5 0/7] Allow user to request memory to be locked on page fault

2015-07-28 Thread Eric B Munson
On Tue, 28 Jul 2015, Michal Hocko wrote: > [I am sorry but I didn't get to this sooner.] > > On Mon 27-07-15 10:54:09, Eric B Munson wrote: > > Now that VM_LOCKONFAULT is a modifier to VM_LOCKED and > > cannot be specified independentally, it might make more sense to mi

Re: [PATCH V5 0/7] Allow user to request memory to be locked on page fault

2015-07-27 Thread Eric B Munson
On Mon, 27 Jul 2015, Vlastimil Babka wrote: > On 07/27/2015 03:35 PM, Eric B Munson wrote: > >On Mon, 27 Jul 2015, Vlastimil Babka wrote: > > > >>On 07/24/2015 11:28 PM, Eric B Munson wrote: > >> > >>... > >> > >>>Changes from V4:

Re: [PATCH V5 5/7] mm: mmap: Add mmap flag to request VM_LOCKONFAULT

2015-07-27 Thread Eric B Munson
On Mon, 27 Jul 2015, Kirill A. Shutemov wrote: > On Mon, Jul 27, 2015 at 09:41:26AM -0400, Eric B Munson wrote: > > On Mon, 27 Jul 2015, Kirill A. Shutemov wrote: > > > > > On Fri, Jul 24, 2015 at 05:28:43PM -0400, Eric B Munson wrote: > > > > The cost of fau

Re: [PATCH V5 5/7] mm: mmap: Add mmap flag to request VM_LOCKONFAULT

2015-07-27 Thread Eric B Munson
On Mon, 27 Jul 2015, Kirill A. Shutemov wrote: > On Fri, Jul 24, 2015 at 05:28:43PM -0400, Eric B Munson wrote: > > 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

Re: [PATCH V5 0/7] Allow user to request memory to be locked on page fault

2015-07-27 Thread Eric B Munson
On Mon, 27 Jul 2015, Vlastimil Babka wrote: > On 07/24/2015 11:28 PM, Eric B Munson wrote: > > ... > > >Changes from V4: > >Drop all architectures for new sys call entries except x86[_64] and MIPS > >Drop munlock2 and munlockall2 > >Make VM_LOCKONFAULT a mo

[PATCH V5 2/7] mm: mlock: Add new mlock system call

2015-07-24 Thread Eric B Munson
With the refactored mlock code, introduce a new system call for mlock. The new call will allow the user to specify what lock states are being added. mlock2 is trivial at the moment, but a follow on patch will add a new mlock state making it useful. Signed-off-by: Eric B Munson Cc: Michal Hocko

[PATCH V5 7/7] mips: Add entry for new mlock2 syscall

2015-07-24 Thread Eric B Munson
A previous commit introduced the new mlock2 syscall, add entries for the MIPS architecture. Signed-off-by: Eric B Munson Cc: Ralf Baechle Cc: linux-m...@linux-mips.org Cc: linux-...@vger.kernel.org Cc: linux-a...@vger.kernel.org Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org --- arch

[PATCH V5 5/7] mm: mmap: Add mmap flag to request VM_LOCKONFAULT

2015-07-24 Thread Eric B Munson
MAP_LOCKED -> VM_LOCKED. Signed-off-by: Eric B Munson Cc: Michal Hocko Cc: Vlastimil Babka Cc: Paul Gortmaker Cc: Chris Metcalf Cc: Guenter Roeck Cc: linux-al...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-m...@linux-mips.org Cc: linux-par...@vger.kernel.org Cc: linux

[PATCH V5 6/7] selftests: vm: Add tests for lock on fault

2015-07-24 Thread Eric B Munson
that the limit test needs to be run a normal user. Also add tests to use the new mlock2 family of system calls. Signed-off-by: Eric B Munson Cc: Shuah Khan Cc: Michal Hocko Cc: Vlastimil Babka Cc: Jonathan Corbet Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org Cc: linux

[PATCH V5 0/7] Allow user to request memory to be locked on page fault

2015-07-24 Thread Eric B Munson
g how memory is locked or unlocked. Eric B Munson (7): mm: mlock: Refactor mlock, munlock, and munlockall code mm: mlock: Add new mlock system call mm: Introduce VM_LOCKONFAULT mm: mlock: Add mlock flags to enable VM_LOCKONFAULT usage mm: mmap: Add mmap flag to request VM_LOCKON

[PATCH V5 4/7] mm: mlock: Add mlock flags to enable VM_LOCKONFAULT usage

2015-07-24 Thread Eric B Munson
second call to mlock2(MLOCK_LOCKED) will accomplish this. munlock() will unconditionally clear both vma flags. munlockall() unconditionally clears for VMA flags on all VMAs and in the mm->def_flags field. Signed-off-by: Eric B Munson Cc: Michal Hocko Cc: Vlastimil Babka Cc: Jonathan Corbet

[PATCH V5 1/7] mm: mlock: Refactor mlock, munlock, and munlockall code

2015-07-24 Thread Eric B Munson
code needs some reorganization so that all the actual entry point handles is checking input and translating to VMA flags. Signed-off-by: Eric B Munson Cc: Michal Hocko Cc: Vlastimil Babka Cc: "Kirill A. Shutemov" Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org --- mm/ml

[PATCH V5 3/7] mm: Introduce VM_LOCKONFAULT

2015-07-24 Thread Eric B Munson
to communicate the locked state of a VMA. FOLL_POPULATE will now only control if the VMA should be populated and in the case of VM_LOCKONFAULT, it will not be set. Signed-off-by: Eric B Munson Cc: Michal Hocko Cc: Vlastimil Babka Cc: Jonathan Corbet Cc: "Kirill A. Shutemov" Cc: li

Re: [PATCH V4 2/6] mm: mlock: Add new mlock, munlock, and munlockall system calls

2015-07-24 Thread Eric B Munson
On Fri, 24 Jul 2015, Guenter Roeck wrote: > On 07/24/2015 07:39 AM, Eric B Munson wrote: > >On Thu, 23 Jul 2015, Ralf Baechle wrote: > > > >>On Wed, Jul 22, 2015 at 10:15:01AM -0400, Eric B Munson wrote: > >> > >>>> > >>>>You have

Re: [PATCH V4 2/6] mm: mlock: Add new mlock, munlock, and munlockall system calls

2015-07-24 Thread Eric B Munson
On Thu, 23 Jul 2015, Ralf Baechle wrote: > On Wed, Jul 22, 2015 at 10:15:01AM -0400, Eric B Munson wrote: > > > > > > > You haven't wired it up properly on powerpc, but I haven't mentioned it > > > because > > > I'd rather we did

Re: [PATCH v4 00/10] hugetlbfs: add fallocate support

2015-07-23 Thread Eric B Munson
On Thu, 23 Jul 2015, Mike Kravetz wrote: > On 07/23/2015 08:17 AM, Eric B Munson wrote: > >On Wed, 22 Jul 2015, Mike Kravetz wrote: > > > >>On 07/22/2015 03:30 PM, Andrew Morton wrote: > >>>On Wed, 22 Jul 2015 15:19:54 -0700 Davidlohr Bueso > >>&g

Re: [PATCH V4 4/6] mm: mlock: Introduce VM_LOCKONFAULT and add mlock flags to enable it

2015-07-23 Thread Eric B Munson
On Thu, 23 Jul 2015, Vlastimil Babka wrote: > On 07/22/2015 08:43 PM, Eric B Munson wrote: > > On Wed, 22 Jul 2015, Vlastimil Babka wrote: > > > >> > >> Hi, > >> > >> I think you should include a complete description of which > >> tra

Re: [PATCH v4 00/10] hugetlbfs: add fallocate support

2015-07-23 Thread Eric B Munson
On Wed, 22 Jul 2015, Mike Kravetz wrote: > On 07/22/2015 03:30 PM, Andrew Morton wrote: > >On Wed, 22 Jul 2015 15:19:54 -0700 Davidlohr Bueso wrote: > > > >>> > >>>I didn't know that libhugetlbfs has tests. I wonder if that makes > >>>tools/testing/selftests/vm's hugetlbfstest harmful? > >> > >>

Re: [PATCH V4 4/6] mm: mlock: Introduce VM_LOCKONFAULT and add mlock flags to enable it

2015-07-22 Thread Eric B Munson
On Wed, 22 Jul 2015, Vlastimil Babka wrote: > On 07/21/2015 09:59 PM, Eric B Munson wrote: > >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 hig

Re: [PATCH V4 5/6] mm: mmap: Add mmap flag to request VM_LOCKONFAULT

2015-07-22 Thread Eric B Munson
On Wed, 22 Jul 2015, Kirill A. Shutemov wrote: > On Tue, Jul 21, 2015 at 03:59:40PM -0400, Eric B Munson wrote: > > 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

Re: [PATCH V4 2/6] mm: mlock: Add new mlock, munlock, and munlockall system calls

2015-07-22 Thread Eric B Munson
On Wed, 22 Jul 2015, Michael Ellerman wrote: > On Tue, 2015-07-21 at 13:44 -0700, Andrew Morton wrote: > > On Tue, 21 Jul 2015 15:59:37 -0400 Eric B Munson wrote: > > > > > With the refactored mlock code, introduce new system calls for mlock, > > > munlock, an

Re: [PATCH V4 3/6] mm: gup: Add mm_lock_present()

2015-07-22 Thread Eric B Munson
On Wed, 22 Jul 2015, Kirill A. Shutemov wrote: > On Tue, Jul 21, 2015 at 03:59:38PM -0400, Eric B Munson wrote: > > The upcoming mlock(MLOCK_ONFAULT) implementation will need a way to > > request that all present pages in a range are locked without faulting in > > pages

Re: [PATCH V4 1/6] mm: mlock: Refactor mlock, munlock, and munlockall code

2015-07-22 Thread Eric B Munson
On Wed, 22 Jul 2015, Kirill A. Shutemov wrote: > On Tue, Jul 21, 2015 at 03:59:36PM -0400, Eric B Munson wrote: > > @@ -648,20 +656,23 @@ SYSCALL_DEFINE2(munlock, unsigned long, start, > > size_t, len) > > start &= PAGE_MASK; > > > > down_write(¤t-&

Re: [PATCH V4 2/6] mm: mlock: Add new mlock, munlock, and munlockall system calls

2015-07-22 Thread Eric B Munson
On Wed, 22 Jul 2015, Vlastimil Babka wrote: > On 07/21/2015 09:59 PM, Eric B Munson wrote: > >With the refactored mlock code, introduce new system calls for mlock, > >munlock, and munlockall. The new calls will allow the user to specify > >what lock states are being added or

[PATCH V4 2/6] mm: mlock: Add new mlock, munlock, and munlockall system calls

2015-07-21 Thread Eric B Munson
new munlockall2 system call allows a user to simply clear the MCL_FUTURE flag. Signed-off-by: Eric B Munson Cc: Michal Hocko Cc: Vlastimil Babka Cc: Heiko Carstens Cc: Geert Uytterhoeven Cc: Catalin Marinas Cc: Stephen Rothwell Cc: Guenter Roeck Cc: linux-al...@vger.kernel.org Cc: linux

[PATCH V4 0/6] Allow user to request memory to be locked on page fault

2015-07-21 Thread Eric B Munson
missing syscall entries, fix NR_syscalls on multiple arch's Add missing MAP_LOCKONFAULT for tile Changes from V2: Added new system calls for mlock, munlock, and munlockall with added flags arguments for controlling how memory is locked or unlocked. Eric B Munson (6): mm: mlock: Refactor

[PATCH V4 4/6] mm: mlock: Introduce VM_LOCKONFAULT and add mlock flags to enable it

2015-07-21 Thread Eric B Munson
B Munson Cc: Michal Hocko Cc: Vlastimil Babka Cc: Jonathan Corbet Cc: linux-al...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-m...@linux-mips.org Cc: linux-par...@vger.kernel.org Cc: linuxppc-...@lists.ozlabs.org Cc: sparcli...@vger.kernel.org Cc: linux-xte...@linux-xtensa.org Cc

[PATCH V4 5/6] mm: mmap: Add mmap flag to request VM_LOCKONFAULT

2015-07-21 Thread Eric B Munson
MAP_LOCKED -> VM_LOCKED. Signed-off-by: Eric B Munson Cc: Michal Hocko Cc: Vlastimil Babka Cc: Paul Gortmaker Cc: Chris Metcalf Cc: Guenter Roeck Cc: linux-al...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-m...@linux-mips.org Cc: linux-par...@vger.kernel.org Cc: linux

[PATCH V4 6/6] selftests: vm: Add tests for lock on fault

2015-07-21 Thread Eric B Munson
that the limit test needs to be run a normal user. Also add tests to use the new mlock2 family of system calls. Signed-off-by: Eric B Munson Cc: Shuah Khan Cc: Michal Hocko Cc: Vlastimil Babka Cc: Jonathan Corbet Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org Cc: linux

[PATCH V4 3/6] mm: gup: Add mm_lock_present()

2015-07-21 Thread Eric B Munson
can be shared and adds mm_lock_present() to gup.c. The following patch will call it from do_mlock() when MLOCK_ONFAULT is specified. Signed-off-by: Eric B Munson Cc: Jonathan Corbet Cc: Vlastimil Babka Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org --- mm/gup.c | 172

[PATCH V4 1/6] mm: mlock: Refactor mlock, munlock, and munlockall code

2015-07-21 Thread Eric B Munson
introduces new system calls that allow the user to specify flags for these calls. Signed-off-by: Eric B Munson Cc: Michal Hocko Cc: Vlastimil Babka Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org --- mm/mlock.c | 57 ++--- 1 file

Re: [PATCH V3 4/5] mm: mmap: Add mmap flag to request VM_LOCKONFAULT

2015-07-21 Thread Eric B Munson
On Mon, 20 Jul 2015, Chris Metcalf wrote: > On 07/18/2015 03:11 PM, Paul Gortmaker wrote: > >On Tue, Jul 7, 2015 at 1:03 PM, Eric B Munson wrote: > >>>The cost of faulting in all memory to be locked can be very high when > >>>working with large mappings. If onl

Re: linux-next: build failure after merge of the akpm-current tree

2015-07-20 Thread Eric B Munson
On Fri, 17 Jul 2015, Stephen Rothwell wrote: > Hi Eric, > > On Thu, 16 Jul 2015 10:36:59 -0400 Eric B Munson wrote: > > > > > From: Stephen Rothwell Date: Thu, 16 Jul > > > 2015 14:58:53 +1000 Subject: [PATCH] mm: mlock: fix for add new > > > m

Re: linux-next: build failure after merge of the akpm-current tree

2015-07-16 Thread Eric B Munson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/16/2015 01:20 AM, Stephen Rothwell wrote: > Hi Andrew, > > After merging the akpm-current tree, today's linux-next build (arm > multi_v7_defconfig) failed like this: > > arch/arm/kernel/entry-common.S: Assembler messages: > arch/arm/kernel/en

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 > &g

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&#x

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.

Re: [PATCH V3 0/5] Allow user to request memory to be locked on page fault

2015-07-08 Thread Eric B Munson
On Tue, 07 Jul 2015, Andrew Morton wrote: > On Tue, 7 Jul 2015 13:03:38 -0400 Eric B Munson wrote: > > > mlock() allows a user to control page out of program memory, but this > > comes at the cost of faulting in the entire mapping when it is > > allocated. For large m

[PATCH V3 1/5] mm: mlock: Refactor mlock, munlock, and munlockall code

2015-07-07 Thread Eric B Munson
introduces new system calls that allow the user to specify flags for these calls. Signed-off-by: Eric B Munson Cc: Michal Hocko Cc: Vlastimil Babka Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org --- mm/mlock.c | 57 ++--- 1 file

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

2015-07-07 Thread Eric B Munson
the entire mapping lock as if MLOCK_LOCKED was used. Signed-off-by: Eric B Munson Cc: Michal Hocko Cc: Vlastimil Babka Cc: linux-al...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-m...@linux-mips.org Cc: linux-par...@vger.kernel.org Cc: linuxppc-...@lists.ozlabs.org Cc: sparcli

[PATCH V3 4/5] mm: mmap: Add mmap flag to request VM_LOCKONFAULT

2015-07-07 Thread Eric B Munson
MAP_LOCKED -> VM_LOCKED. Signed-off-by: Eric B Munson Cc: Michal Hocko Cc: Vlastimil Babka Cc: linux-al...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-m...@linux-mips.org Cc: linux-par...@vger.kernel.org Cc: linuxppc-...@lists.ozlabs.org Cc: sparcli...@vger.kernel.org Cc: linux-

[PATCH V3 2/5] mm: mlock: Add new mlock, munlock, and munlockall system calls

2015-07-07 Thread Eric B Munson
new munlockall2 system call allows a user to simply clear the MCL_FUTURE flag. Signed-off-by: Eric B Munson Cc: Michal Hocko Cc: Vlastimil Babka Cc: linux-al...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-arm-ker...@lists.infradead.org Cc: adi-buildroot-de...@lists.sourceforge.net

[PATCH V3 0/5] Allow user to request memory to be locked on page fault

2015-07-07 Thread Eric B Munson
9.7335 9.7085 Context Switches 22211.5 22412.1 Sleeps 14965.3 14956.1 --- Changes from V2: Added new system calls for mlock, munlock, and munlockall with added flags arguments for controlling how memory is locked or unlocked. Eric B Munson (5): mm: mlock: Refactor mlock, munlock

[PATCH V3 5/5] selftests: vm: Add tests for lock on fault

2015-07-07 Thread Eric B Munson
that the limit test needs to be run a normal user. Signed-off-by: Eric B Munson Cc: Shuah Khan Cc: Michal Hocko Cc: Vlastimil Babka Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org Cc: linux-...@vger.kernel.org --- tools/testing/selftests/vm/Makefile | 2 + tools/testing

Re: [RESEND PATCH V2 1/3] Add mmap flag to request pages are locked after page fault

2015-06-25 Thread Eric B Munson
On Wed, 24 Jun 2015, Michal Hocko wrote: > On Mon 22-06-15 10:18:06, Eric B Munson wrote: > > On Mon, 22 Jun 2015, Michal Hocko wrote: > > > > > On Fri 19-06-15 12:43:33, Eric B Munson wrote: > [...] > > > > Are you objecting to the addition of the VMA

Re: [RESEND PATCH V2 0/3] Allow user to request memory to be locked on page fault

2015-06-25 Thread Eric B Munson
On Tue, 23 Jun 2015, Vlastimil Babka wrote: > On 06/15/2015 04:43 PM, Eric B Munson wrote: > >>Note that the semantic of MAP_LOCKED can be subtly surprising: > >> > >>"mlock(2) fails if the memory range cannot get populated to guarantee > >>that no

Re: [RESEND PATCH V2 1/3] Add mmap flag to request pages are locked after page fault

2015-06-22 Thread Eric B Munson
On Mon, 22 Jun 2015, Michal Hocko wrote: > On Fri 19-06-15 12:43:33, Eric B Munson wrote: > > On Fri, 19 Jun 2015, Michal Hocko wrote: > > > > > On Thu 18-06-15 16:30:48, Eric B Munson wrote: > > > > On Thu, 18 Jun 2015, Michal Hocko wrote: > >

  1   2   >