Thread (64 messages) 64 messages, 7 authors, 2025-04-22

Re: [PATCH 0/4] mm: permit guard regions for file-backed/shmem mappings

From: David Hildenbrand <hidden>
Date: 2025-02-18 17:32:00
Also in: linux-kselftest, linux-mm, lkml

quoted
See mlock2();

SYSCALL_DEFINE3(mlock2, unsigned long, start, size_t, len, int, flags)
{
	vm_flags_t vm_flags = VM_LOCKED;

	if (flags & ~MLOCK_ONFAULT)
		return -EINVAL;

	if (flags & MLOCK_ONFAULT)
		vm_flags |= VM_LOCKONFAULT;

	return do_mlock(start, len, vm_flags);
}


VM_LOCKONFAULT always as VM_LOCKED set as well.
OK cool, that makes sense.

As with much kernel stuff, I knew this in the past. Then I forgot. Then I knew
again, then... :P if only somebody would write it down in a book...
And if there would be such a book in the makings, I would consider 
hurrying up and preordering it ;)

-- 
Cheers,

David / dhildenb
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help