From: Michel Lespinasse <walken@google.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
Tao Ma <tm@tao.ma>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Rik van Riel <riel@redhat.com>, Hugh Dickins <hughd@google.com>
Subject: Re: [PATCH] mlock: operate on any regions with protection != PROT_NONE
Date: Mon, 31 Jan 2011 22:36:16 -0800 [thread overview]
Message-ID: <AANLkTinjoq1bdDLSbTaSi4eJZ73jbdAsvJOyZy93xYQT@mail.gmail.com> (raw)
In-Reply-To: <AANLkTinG7eHR1_kfEyvJYw52ngyvqv5UzigEOddsi9ye@mail.gmail.com>
On Mon, Jan 31, 2011 at 9:59 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Tue, Feb 1, 2011 at 11:03 AM, Michel Lespinasse <walken@google.com> wrote:
>>
>> I am proposing to let mlock ignore vma protection in all cases except
>> PROT_NONE.
>
> What's so special about PROT_NONE? If you want to mlock something
> without actually being able to then fault that in, why not?
>
> IOW, why wouldn't it be right to just make FOLL_FORCE be unconditional in mlock?
I agree this would be the most logical thing to do, but I'm afraid
people would complain about it as it'd be yet another behavior change.
I don't have the entire context here, but PROT_NONE regions are
actually common in modern userspace. It seems that for most shared
libraries, ld.so creates 4 vmas, one of them being just under 2MB and
with PROT_NONE protection. From my shell, if I do cat /proc/$$/maps, I
see:
[...]
7f41ebdb5000-7f41ebdc5000 r-xp 00000000 fc:03 669498
/usr/lib/zsh/4.3.10/zsh/computil.so
7f41ebdc5000-7f41ebfc4000 ---p 00010000 fc:03 669498
/usr/lib/zsh/4.3.10/zsh/computil.so
7f41ebfc4000-7f41ebfc5000 r--p 0000f000 fc:03 669498
/usr/lib/zsh/4.3.10/zsh/computil.so
7f41ebfc5000-7f41ebfc6000 rw-p 00010000 fc:03 669498
/usr/lib/zsh/4.3.10/zsh/computil.so
7f41ebfc6000-7f41ebfce000 r-xp 00000000 fc:03 669508
/usr/lib/zsh/4.3.10/zsh/parameter.so
7f41ebfce000-7f41ec1ce000 ---p 00008000 fc:03 669508
/usr/lib/zsh/4.3.10/zsh/parameter.so
7f41ec1ce000-7f41ec1cf000 r--p 00008000 fc:03 669508
/usr/lib/zsh/4.3.10/zsh/parameter.so
7f41ec1cf000-7f41ec1d0000 rw-p 00009000 fc:03 669508
/usr/lib/zsh/4.3.10/zsh/parameter.so
[...]
I don't know why userspace does that, but these regions currently
never get any page into RSS, even when processes call mlockall(). I am
told that we need to preserve this property.
--
Michel "Walken" Lespinasse
A program is never fully debugged until the last user dies.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-02-01 6:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-01 1:03 Michel Lespinasse
2011-02-01 1:08 ` Michel Lespinasse
2011-02-01 5:59 ` Linus Torvalds
2011-02-01 6:36 ` Michel Lespinasse [this message]
2011-02-01 17:57 ` Rik van Riel
2011-02-01 17:57 ` Rik van Riel
2011-02-03 0:57 ` KOSAKI Motohiro
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=AANLkTinjoq1bdDLSbTaSi4eJZ73jbdAsvJOyZy93xYQT@mail.gmail.com \
--to=walken@google.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-mm@kvack.org \
--cc=riel@redhat.com \
--cc=tm@tao.ma \
--cc=torvalds@linux-foundation.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