Thread (17 messages) flat view 17 messages, 5 authors, 2020-02-14

Re: [PATCH v4] mm: Add MREMAP_DONTUNMAP to mremap().

From: Kirill A. Shutemov <hidden>
Date: 2020-02-13 12:07:57
Also in: linux-mm, lkml

On Mon, Feb 10, 2020 at 06:12:39AM -0800, Brian Geffon wrote:
Hi Kirill,
If the old_len == new_len then there is no change in the number of
locked pages they just moved, if the new_len < old_len then the
process of unmapping (new_len - old_len) bytes from the old mapping
will handle the locked page accounting. So in this special case where
we're growing the VMA, vma_to_resize() will enforce that growing the
vma doesn't exceed RLIMIT_MEMLOCK, but vma_to_resize() doesn't handle
incrementing mm->locked_bytes which is why we have that special case
incrementing it here.
But if you do the operation for the VM_LOCKED vma, you'll have two locked
VMA's now, right? Where do you account the old locked vma you left behind?

-- 
 Kirill A. Shutemov
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help