linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: William Lee Irwin III <wli@holomorphy.com>,
	"Martin J. Bligh" <mbligh@aracnet.com>,
	Mel Gorman <mel@csn.ul.ie>,
	Linux Memory Management List <linux-mm@kvack.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: What to expect with the 2.6 VM
Date: Thu, 3 Jul 2003 00:02:46 +0200	[thread overview]
Message-ID: <20030702220246.GS23578@dualathlon.random> (raw)
In-Reply-To: <20030702214032.GH20413@holomorphy.com>

On Wed, Jul 02, 2003 at 02:40:32PM -0700, William Lee Irwin III wrote:
> On Wed, Jul 02, 2003 at 07:47:00PM +0200, Andrea Arcangeli wrote:
> > actually other more invasive ways could be to move rmap into highmem.
> > Also the page clustering could also hide part of the mem overhead by
> > assuming the pagetables to be contiguos, but page clustering isn't part
> > of mainline yet either.
> 
> BSD-style page clustering preserves virtual contiguity of a software
> page, but the new things don't; for ABI preservation, virtually
> discontiguous, partial, and misaligned mappings of pages are handled.
> 
> The desired behavior can in principle be partially recovered by
> scanning within a software page size -sized "blast radius" for each
> chain element and only chaining enough elements to find the relevant
> ptes that way.
> 
> As for remap_file_pages(), either people are misunderstanding or
> ignoring me. There is a lovely three-step method to handling it:
> 
> (a) fix the truncate() bug; it is just a literal bug. There are at
> 	least 3 different ways to fix it:
> 	(i) tag vmas touched by remap_file_pages() for exhaustive search
> 	(ii) do a cleanup pass after the current vmtruncate() doing
> 		try_to_unmap() on any still-mapped pages
> 	(iii) drop the current vmtruncate() entirely and do try_to_unmap()
> 		on each truncated page
> 	(ii) and (iii) do the locks in the wrong order, so some still-
> 	mapped but truncated page could be out there; this could be
> 	handed by Yet Another Cleanup Pass that does (i) or by tolerating
> 	the new state elsewhere in the VM. There's plenty of ways to
> 	code this and a couple choices of semantics (i.e make it
> 	failable or reliable).
> 
> (b) implement the bits omitting pte_chains for mlock()'d mappings
> 	This is obvious. Yank them off the LRU, set a bitflag, and
> 	reuse page->lru for a counter.
> 
> (c) redo the logic around page_convert_anon() and incrementally build
> 	pte_chains for remap_file_pages().
> 	The anobjrmap code did exactly this, but it was chaining
> 	distinct user virtual addresses instead.
> 	(i) you always have the pte_chain in hand anyway; the core
> 		is always prepped to handle allocating them now
> 	(ii) instead of just bailing for file-backed pages in
> 		page_add_rmap(), pass it enough information to know
> 		whether the address matches what it should from the
> 		vma, and start chaining if it doesn't
> 	(iii) but you say ->mapcount sharing space with the chain is a
> 		problem? no, it's not; again, take a cue from anobjrmap:
> 		if a file-backed page needs a pte_chain, shoehorn
> 		->mapcount into the first pte_chain block dangling off it
> 
> After all 3 are done, remap_file_pages() integrates smoothly into the VM,
> requires no magical privileges, nothing magical or brutally invasive
> that would scare people just before 2.6.0 is required, and the big
> apps can get their magical lowmem savings by just mlock()'ing _anything_
> they do massive sharing with, regardless of remap_file_pages().
> 
> Does anyone get it _now_?

the problem with the above is that it is an order of magnitude more
complicated than just providing the feature remap_file_pages is been
written for. Removing the pte_chains via mlock is trivial, but then go
ahead and rebuild it synchronously in O(N) scanning the whole 1T of
virtual address space when I munlock.

In turn I still prefer the simplest possible approch. I see no strong
reason why we should complicate the kernel like that to make
remap_file_pages generic.

IMHO remap_file_pages wouldn't exist today in the kernel if 32bit archs
would be limited to 4G of ram. It's primarly a 32bit hack and as such we
should try to get away with it with the minimal damage to the rest of
the kernel (in a way that emulator can use too though, via a sysctl or
similar).

Now releasing the pte_chain during mlock would be a generic feature
orthogonal with the above I know, but I doubt you really care about it
for all other usages (also given the nearly unfixable complexity it
would introduce in munlock).

Andrea
--
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/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

  parent reply	other threads:[~2003-07-02 22:02 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-01  1:39 Mel Gorman
2003-06-30 17:43 ` Daniel Phillips
2003-07-01 20:10   ` Martin J. Bligh
2003-07-01 21:41   ` Mel Gorman
2003-07-01 21:51     ` Davide Libenzi
2003-07-01 21:58     ` Martin J. Bligh
2003-07-02  9:01       ` Mel Gorman
2003-07-01  2:25 ` Andrea Arcangeli
2003-07-01  3:02   ` Andrew Morton
2003-07-01  3:22     ` Andrea Arcangeli
2003-07-01  3:25       ` Andrea Arcangeli
2003-07-01  3:29       ` Rik van Riel
2003-07-01  4:04         ` Andrea Arcangeli
2003-07-01 11:01     ` Hugh Dickins
2003-07-01  3:25   ` William Lee Irwin III
2003-07-01  4:39     ` Andrea Arcangeli
2003-07-01  6:33       ` William Lee Irwin III
2003-07-01  7:49         ` Andrea Arcangeli
2003-07-01  8:59           ` William Lee Irwin III
2003-07-01  9:27             ` Andrea Arcangeli
2003-07-01 14:24             ` Martin J. Bligh
2003-07-01 16:22               ` William Lee Irwin III
2003-07-01 17:54                 ` Martin J. Bligh
2003-07-02  3:04                   ` Andrea Arcangeli
2003-07-01 14:42           ` Martin J. Bligh
2003-07-01 21:45     ` Mel Gorman
2003-07-01 22:06       ` Martin J. Bligh
2003-07-01 21:46   ` Mel Gorman
2003-07-02  3:08     ` Andrea Arcangeli
2003-07-02 15:57   ` Mel Gorman
2003-07-02 17:11     ` Andrea Arcangeli
2003-07-02 17:10       ` Martin J. Bligh
2003-07-02 17:47         ` Andrea Arcangeli
2003-07-02 17:52           ` Martin J. Bligh
2003-07-02 18:13             ` Andrea Arcangeli
2003-07-02 18:05           ` Rik van Riel
2003-07-02 20:05             ` Martin J. Bligh
2003-07-02 21:40           ` William Lee Irwin III
2003-07-02 21:48             ` Martin J. Bligh
2003-07-02 22:14               ` William Lee Irwin III
2003-07-02 22:02             ` Andrea Arcangeli [this message]
2003-07-02 22:15               ` William Lee Irwin III
2003-07-02 22:26                 ` Andrea Arcangeli
2003-07-02 23:11                   ` William Lee Irwin III
2003-07-02 23:30                     ` Andrea Arcangeli
2003-07-02 23:55                       ` William Lee Irwin III
2003-07-03 11:31                         ` Andrea Arcangeli
2003-07-03 11:46                           ` William Lee Irwin III
2003-07-03 12:58                             ` Andrea Arcangeli
2003-07-03 13:06                               ` Rik van Riel
2003-07-03 13:48                                 ` Andrea Arcangeli
2003-07-03 18:53                                 ` William Lee Irwin III
2003-07-03 19:27                                   ` Andrea Arcangeli
2003-07-03 19:32                                     ` Rik van Riel
2003-07-03 20:16                                     ` William Lee Irwin III
2003-07-04  0:40                                       ` Andrea Arcangeli
2003-07-04  1:46                                         ` William Lee Irwin III
2003-07-04  2:34                                           ` Andrea Arcangeli
2003-07-04  4:10                                             ` William Lee Irwin III
2003-07-04  5:54                                               ` Andrea Arcangeli
2003-07-04  8:15                                                 ` William Lee Irwin III
2003-07-04 23:44                                                   ` Andrea Arcangeli
2003-07-05  0:05                                                     ` William Lee Irwin III
2003-07-05  0:08                                                       ` Andrea Arcangeli
2003-07-03 18:48                               ` Jamie Lokier
2003-07-03 18:54                                 ` William Lee Irwin III
2003-07-03 19:33                                   ` Andrea Arcangeli
2003-07-03 22:21                                     ` William Lee Irwin III
2003-07-04  0:46                                       ` Andrea Arcangeli
2003-07-04  1:33                                         ` Jamie Lokier
2003-07-04  1:36                                         ` William Lee Irwin III
2003-07-03 19:06                           ` Andrew Morton
2003-07-03 19:34                             ` Andrea Arcangeli
2003-07-02 18:07         ` Rik van Riel

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=20030702220246.GS23578@dualathlon.random \
    --to=andrea@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mbligh@aracnet.com \
    --cc=mel@csn.ul.ie \
    --cc=wli@holomorphy.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox