linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michel Lespinasse <walken@google.com>
To: Hugh Dickins <hughd@google.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	linux-mm <linux-mm@kvack.org>
Subject: Re: RFC: reviving mlock isolation dead code
Date: Mon, 15 Nov 2010 22:50:59 -0800	[thread overview]
Message-ID: <AANLkTin+16yDxGrRfbqw9OPnDDV8OgXr_nbZnXJEHK9w@mail.gmail.com> (raw)
In-Reply-To: <alpine.LSU.2.00.1011151717130.10920@tigran.mtv.corp.google.com>

On Mon, Nov 15, 2010 at 5:44 PM, Hugh Dickins <hughd@google.com> wrote:
> On Sun, 14 Nov 2010, KOSAKI Motohiro wrote:
>> Michel Lespinasse <walken@google.com> wrote:
>> > ...
>> > The other mlock related issue I have is that it marks pages as dirty
>> > (if they are in a writable VMA), and causes writeback to work on them,
>> > even though the pages have not actually been modified. This looks like
>> > it would be solvable with a new get_user_pages flag for mlock use
>> > (breaking cow etc, but not writing to the pages just yet).
>>
>> To be honest, I haven't understand why current code does so. I dislike it too. but
>> I'm not sure such change is safe or not. I hope another developer comment you ;-)
>
> It's been that way for years, and the primary purpose is to do the COWs
> in advance, so we won't need to allocate new pages later to the locked
> area: the pages that may be needed are already locked down.

Thanks Hugh for posting your comments. I was aware of Suleiman's
proposal to always do a READ mode get_user_pages years ago, and I
could see that we'd need a new flag instead so we can break COW
without dirtying pages, but I hadn't thought about other issues.

> That justifies it for the private mapping case, but what of shared maps?
> There the justification is that the underlying file might be sparse, and
> we want to allocate blocks upfront for the locked area.
>
> Do we?  I dislike it also, as you both do.  It seems crazy to mark a
> vast number of pages as dirty when they're not.
>
> It makes sense to mark pte_dirty when we have a real write fault to a
> page, to save the mmu from making that pagetable transaction immediately
> after; but it does not make sense when the write (if any) may come
> minutes later - we'll just do a pointless write and clear dirty meanwhile

  reply	other threads:[~2010-11-16  6:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-30 10:16 RFC: reviving mlock isolation dead code Michel Lespinasse
2010-10-30 12:48 ` Michel Lespinasse
2010-11-01  7:05 ` KOSAKI Motohiro
2010-11-09  4:34   ` KOSAKI Motohiro
2010-11-10 12:21     ` Michel Lespinasse
2010-11-14  5:07       ` KOSAKI Motohiro
2010-11-16  1:44         ` Hugh Dickins
2010-11-16  6:50           ` Michel Lespinasse [this message]
2010-11-16 23:28             ` Hugh Dickins
2010-11-18 11:16               ` Michel Lespinasse

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=AANLkTin+16yDxGrRfbqw9OPnDDV8OgXr_nbZnXJEHK9w@mail.gmail.com \
    --to=walken@google.com \
    --cc=hughd@google.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-mm@kvack.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).