From: Eric B Munson <emunson@akamai.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Shuah Khan <shuahkh@osg.samsung.com>,
Michal Hocko <mhocko@suse.cz>,
linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mips@linux-mips.org, linux-parisc@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org,
linux-xtensa@linux-xtensa.org, linux-mm@kvack.org,
linux-arch@vger.kernel.org, linux-api@vger.kernel.org
Subject: Re: [RESEND PATCH 0/3] Allow user to request memory to be locked on page fault
Date: Tue, 2 Jun 2015 10:25:20 -0400 [thread overview]
Message-ID: <20150602142520.GB2364@akamai.com> (raw)
In-Reply-To: <20150601152746.abbbbb9d479c0e2dbdec2aaf@linux-foundation.org>
[-- Attachment #1: Type: text/plain, Size: 2688 bytes --]
On Mon, 01 Jun 2015, Andrew Morton wrote:
> On Fri, 29 May 2015 10:13:25 -0400 Eric B Munson <emunson@akamai.com> 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 mappings where the entire area is not necessary
> > this is not ideal.
> >
> > This series introduces new flags for mmap() and mlockall() that allow a
> > user to specify that the covered are should not be paged out, but only
> > after the memory has been used the first time.
>
> I almost applied these, but the naming issue (below) stopped me.
>
> A few things...
>
> - The 0/n changelog should reveal how MAP_LOCKONFAULT interacts with
> rlimit(RLIMIT_MEMLOCK).
>
> I see the implementation is "as if the entire mapping will be
> faulted in" (for mmap) and "as if it was MCL_FUTURE" (for mlockall)
> which seems fine. Please include changelog text explaining and
> justifying these decisions. This stuff will need to be in the
> manpage updates as well.
Change logs are updated, and this will be included in the man page
update as well.
>
> - I think I already asked "why not just use MCL_FUTURE" but I forget
> the answer ;) In general it is a good idea to update changelogs in
> response to reviewer questions, because other people will be
> wondering the same things. Or maybe I forgot to ask. Either way,
> please address this in the changelogs.
I must have missed that question. Here is the text from the updated
mlockall changelog:
MCL_ONFAULT is preferrable to MCL_FUTURE for the use cases enumerated
in the previous patch becuase MCL_FUTURE will behave as if each mapping
was made with MAP_LOCKED, causing the entire mapping to be faulted in
when new space is allocated or mapped. MCL_ONFAULT allows the user to
delay the fault in cost of any given page until it is actually needed,
but then guarantees that that page will always be resident.
>
> - I can perhaps see the point in mmap(MAP_LOCKONFAULT) (other
> mappings don't get lock-in-memory treatment), but what's the benefit
> in mlockall(MCL_ON_FAULT) over MCL_FUTURE? (Add to changelog also,
> please).
>
> - Is there a manpage update?
I will send one out when I post V2
>
> - Can we rename patch 1/3 from "add flag to ..." to "add mmap flag to
> ...", to distinguish from 2/3 "add mlockall flag ..."?
Done
>
> - The MAP_LOCKONFAULT versus MCL_ON_FAULT inconsistency is
> irritating! Can we get these consistent please: switch to either
> MAP_LOCK_ON_FAULT or MCL_ONFAULT.
Yes, will do for V2.
>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2015-06-02 14:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-29 14:13 [RESEND PATCH 0/3] Allow user to request memory to be locked on page fault Eric B Munson
2015-05-29 14:13 ` [RESEND PATCH 1/3] Add flag to request pages are locked after " Eric B Munson
2015-05-29 14:13 ` [RESEND PATCH 2/3] Add mlockall flag for locking pages on fault Eric B Munson
2015-05-29 14:13 ` [RESEND PATCH 3/3] Add tests for lock " Eric B Munson
2015-06-02 15:25 ` Shuah Khan
2015-06-02 16:05 ` Eric B Munson
2015-06-01 22:27 ` [RESEND PATCH 0/3] Allow user to request memory to be locked on page fault Andrew Morton
2015-06-02 14:25 ` Eric B Munson [this message]
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=20150602142520.GB2364@akamai.com \
--to=emunson@akamai.com \
--cc=akpm@linux-foundation.org \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=linux-mm@kvack.org \
--cc=linux-parisc@vger.kernel.org \
--cc=linux-xtensa@linux-xtensa.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mhocko@suse.cz \
--cc=shuahkh@osg.samsung.com \
--cc=sparclinux@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).