From: Eric B Munson <emunson@akamai.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Vlastimil Babka <vbabka@suse.cz>,
Jonathan Corbet <corbet@lwn.net>,
"Kirill A. Shutemov" <kirill@shutemov.name>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-mm@kvack.org, linux-api@vger.kernel.org
Subject: Re: [PATCH v7 3/6] mm: Introduce VM_LOCKONFAULT
Date: Tue, 25 Aug 2015 15:03:00 -0400 [thread overview]
Message-ID: <20150825190300.GG17005@akamai.com> (raw)
In-Reply-To: <20150825185829.GA10222@dhcp22.suse.cz>
[-- Attachment #1: Type: text/plain, Size: 2708 bytes --]
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 suggesting and populate only the full
> > > ranges in a best effort mode (it is done so anyway) and document the
> > > behavior properly.
> > > "
> > > If the memory segment specified by old_address and old_size is
> > > locked (using mlock(2) or similar), then this lock is maintained
> > > when the segment is resized and/or relocated. As a consequence,
> > > the amount of memory locked by the process may change.
> > >
> > > If the range is already fully populated and the range is
> > > enlarged the new range is attempted to be fully populated
> > > as well to preserve the full mlock semantic but there is no
> > > guarantee this will succeed. Partially populated (e.g. created by
> > > mlock(MLOCK_ONFAULT)) ranges do not have the full mlock semantic
> > > so they are not populated on resize.
> > > "
> >
> > You are proposing that mremap would scan the PTEs as Vlastimil has
> > suggested?
>
> As Vlastimil pointed out this would be unnecessarily too costly. But I
> am wondering whether we should populate at all during mremap considering
> the full mlock semantic is not guaranteed anyway. Man page mentions only
> that the lock is maintained which will be true without population as
> well.
>
> If somebody really depends on the current (and broken) implementation we
> can offer MREMAP_POPULATE which would do a best effort population. This
> would be independent on the locked state and would be usable for other
> mappings as well (the usecase would be to save page fault overhead by
> batching them).
>
> If this would be seen as an unacceptable user visible change of behavior
> then we can go with the VMA flag but I would still prefer to not export
> it to the userspace so that we have a way to change this in future.
Would you drop your objections to the VMA flag if I drop the portions of
the patch that expose it to userspace?
The rework to not use the VMA flag is pretty sizeable and is much more
ugly IMO. I know that you are not wild about using bit 30 of 32 for
this, but perhaps we can settle on not exporting it to userspace so we
can reclaim it if we really need it in the future? I can teach the
folks here to check for size vs RSS of the locked mappings for stats on
lock on fault usage so from my point of view, the proc changes are not
necessary.
> --
> Michal Hocko
> SUSE Labs
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-08-25 19:03 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-09 5:22 [PATCH v7 0/6] Allow user to request memory to be locked on page fault Eric B Munson
2015-08-09 5:22 ` [PATCH v7 1/6] mm: mlock: Refactor mlock, munlock, and munlockall code Eric B Munson
2015-08-12 9:42 ` Michal Hocko
2015-08-09 5:22 ` [PATCH v7 2/6] mm: mlock: Add new mlock system call Eric B Munson
2015-08-12 9:45 ` Michal Hocko
2015-08-09 5:22 ` [PATCH v7 3/6] mm: Introduce VM_LOCKONFAULT Eric B Munson
2015-08-12 11:59 ` Michal Hocko
2015-08-19 21:33 ` Eric B Munson
2015-08-20 7:53 ` Vlastimil Babka
2015-08-20 7:56 ` Michal Hocko
2015-08-20 17:03 ` Eric B Munson
2015-08-21 7:25 ` Michal Hocko
2015-08-21 18:31 ` Eric B Munson
2015-08-24 10:17 ` Konstantin Khlebnikov
2015-08-24 13:30 ` Vlastimil Babka
2015-08-24 13:50 ` Konstantin Khlebnikov
2015-08-24 14:27 ` Vlastimil Babka
2015-08-24 15:09 ` Eric B Munson
2015-08-24 15:46 ` Konstantin Khlebnikov
2015-08-24 15:55 ` Eric B Munson
2015-08-24 16:22 ` Konstantin Khlebnikov
2015-08-24 17:00 ` Eric B Munson
2015-08-24 18:53 ` Konstantin Khlebnikov
2015-08-24 20:26 ` Eric B Munson
2015-08-25 13:41 ` Michal Hocko
2015-08-25 13:55 ` Vlastimil Babka
2015-08-25 14:29 ` Michal Hocko
2015-08-25 13:58 ` Konstantin Khlebnikov
2015-08-25 14:29 ` Eric B Munson
2015-08-25 18:58 ` Michal Hocko
2015-08-25 19:03 ` Eric B Munson [this message]
2015-08-26 7:20 ` Michal Hocko
2015-08-26 15:35 ` Vlastimil Babka
2015-08-09 5:22 ` [PATCH v7 4/6] mm: mlock: Add mlock flags to enable VM_LOCKONFAULT usage Eric B Munson
2015-08-09 5:22 ` [PATCH v7 5/6] selftests: vm: Add tests for lock on fault Eric B Munson
2015-08-09 5:22 ` [PATCH v7 6/6] mips: Add entry for new mlock2 syscall Eric B Munson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150825190300.GG17005@akamai.com \
--to=emunson@akamai.com \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=kirill@shutemov.name \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox