Hey John,
On Tue, Jun 11, 2013 at 09:22:47PM -0700, John Stultz wrote:At lsf-mm, the issue was brought up that there is a precedence withIf we have lots of node on vroot but it doesn't include newly mmmaping
interfaces like mlock, such that new mappings in a pre-existing range
do no inherit the mlock state.
This is mostly because mlock only modifies the existing vmas, and so
any new mmaps create new vmas, which won't be mlocked.
Since volatility is not stored in the vma (for good cause, specfically
as we'd have to have manage file volatility differently from anonymous
and we're likely to manage volatility on small chunks of memory, which
would cause lots of vma splitting and churn), this patch clears volatilty
on new mappings, to ensure that we don't inherit volatility if memory in
an existing volatile range is unmapped and then re-mapped with something
else.
Thus, this patch forces any volatility to be cleared on mmap.
vma range, it's purely unnecessary cost and that's never what we want.
XXX: We expect this patch to be not well loved by mm folks, and are openAnother idea is we can add "bool is_vrange" in struct vm_area_struct.
to alternative methods here. Its more of a place holder to address
the issue from lsf-mm and hopefully will spur some further discussion.
It is protected by vrange_lock. The scenario is following as,
When do_vrange is called with VRANGE_VOLATILE, it iterates vmas
and mark the vma->is_vrange to true. So, we can avoid tree traversal
if the is_vrange is false when munmap is called and newly mmaped vma
doesn't need to clear any volatility.