All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rik van Riel <riel@redhat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michel Lespinasse <walken@google.com>,
	linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
	Tao Ma <tm@tao.ma>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Hugh Dickins <hughd@google.com>
Subject: Re: [PATCH] mlock: operate on any regions with protection != PROT_NONE
Date: Tue, 01 Feb 2011 12:57:07 -0500	[thread overview]
Message-ID: <4D484973.6080603@redhat.com> (raw)
In-Reply-To: <AANLkTinG7eHR1_kfEyvJYw52ngyvqv5UzigEOddsi9ye@mail.gmail.com>

On 02/01/2011 12:59 AM, Linus Torvalds 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 could think of a combination of reasons.

Specifically, some libc/linker magic will set up PROT_NONE
areas for programs automatically.

Some programs use mlockall to lock themselves into memory,
with no idea that PROT_NONE areas were set up behind its
back.

Faulting in the PROT_NONE memory will result is wasted
memory, without the application even realizing it.

-- 
All rights reversed

--
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>

  parent reply	other threads:[~2011-02-01 17:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-01  1:03 [PATCH] mlock: operate on any regions with protection != PROT_NONE Michel Lespinasse
2011-02-01  1:08 ` Michel Lespinasse
2011-02-01  5:59 ` Linus Torvalds
2011-02-01  6:36   ` Michel Lespinasse
2011-02-01 17:57   ` Rik van Riel [this message]
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=4D484973.6080603@redhat.com \
    --to=riel@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=tm@tao.ma \
    --cc=torvalds@linux-foundation.org \
    --cc=walken@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.