linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Rik van Riel <riel@conectiva.com.br>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Jamie Lokier <lk@tantalophile.demon.co.uk>,
	Ed Tomlinson <tomlins@cam.org>,
	Marcelo Tosatti <marcelo@conectiva.com.br>,
	linux-mm@kvack.org
Subject: Re: swapout selection change in pre1
Date: Thu, 18 Jan 2001 10:40:32 +1100 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.31.0101181032150.31432-100000@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.10.10101151047540.6247-100000@penguin.transmeta.com>

On Mon, 15 Jan 2001, Linus Torvalds wrote:
> On Mon, 15 Jan 2001, Jamie Lokier wrote:
> >
> > Btw, reverse page mapping resolves this and makes it very simple: no
> > vmscanning (*), so no hand waving heuristic.
>
> Ehh.. Try to actually _implement_ reverse mapping, and THEN say that.
>
> Reverse mapping is basically not simple at all. For each page table entry,
> you need a
>
> 	struct reverse_map {
> 		/* actual pte pointer is implied by location,
> 		   if you implement this cleverly, but still
> 		   needed, of course */
> 		struct reverse_map *prev, *next;
> 		struct vm_struct *vma;
> 	};

Actually, you need only 2 pointers per page.

struct reverse_map {
	pte_t * pte;
	struct reverse_map * next;
};

To find the vma and mm, we will want to use the ->mapping
and ->index in the page_struct of the page table page to
indicate which mm_struct this page table is part of and which
offset this page table has in the mm_struct.

The only thing where this structure will be weak is when
you have many processes mapping the same page and blowing
away this single mapping (eg. on exec after fork, not vfork).

For large (many processes) systems it may be worth it to have
the *prev pointer as well. For small systems we can do without
it and reduce overhead.

Whether this extra memory use is offset by the fact that we can
get page replacement balancing right and page scanning CPU use
more predictable I don't know ... but I want to find out for 2.5 ;)

regards,

Rik
--
Virtual memory is like a game you can't win;
However, without VM there's truly nothing to lose...

		http://www.surriel.com/
http://www.conectiva.com/	http://distro.conectiva.com.br/

--
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.eu.org/Linux-MM/

  parent reply	other threads:[~2001-01-17 23:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-13  3:28 Marcelo Tosatti
2001-01-13  8:05 ` Linus Torvalds
2001-01-13  7:41   ` Marcelo Tosatti
2001-01-15  1:22   ` Ed Tomlinson
2001-01-15  2:48     ` Linus Torvalds
2001-01-15  9:24       ` Jamie Lokier
2001-01-15  8:16         ` Marcelo Tosatti
2001-01-15 18:24         ` Linus Torvalds
2001-01-15 18:40           ` Jamie Lokier
2001-01-15 18:55             ` Linus Torvalds
2001-01-15 21:44               ` Jamie Lokier
2001-01-15 21:57                 ` Linus Torvalds
2001-01-15 22:36                   ` Jamie Lokier
2001-01-17 23:40               ` Rik van Riel [this message]
2001-01-18 15:38                 ` Roman Zippel
2001-01-17  7:19     ` 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=Pine.LNX.4.31.0101181032150.31432-100000@localhost.localdomain \
    --to=riel@conectiva.com.br \
    --cc=linux-mm@kvack.org \
    --cc=lk@tantalophile.demon.co.uk \
    --cc=marcelo@conectiva.com.br \
    --cc=tomlins@cam.org \
    --cc=torvalds@transmeta.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