linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@transmeta.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Jamie Lokier <lk@tantalophile.demon.co.uk>,
	<linux-kernel@vger.kernel.org>
Subject: Re: /proc/<n>/maps getting _VERY_ long
Date: Fri, 10 Aug 2001 16:26:00 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.33.0108101618270.1045-100000@penguin.transmeta.com> (raw)
In-Reply-To: <3B745990.7040808@zytor.com>


On Fri, 10 Aug 2001, H. Peter Anvin wrote:
>
> Note that it isn't very hard to deal with *that* problem, *if you want
> to*... you just need to maintain a shadow data structure in the same
> format as the page tables and stuff your software bits in there.

Actually, this is what Linux already does.

The Linux page tables _are_ a "shadow data structure", and are
conceptually independent from the hardware page tables (or hash table, or
whatever the actual hardware uses to actually fill in the TLB).

This is most clearly seen on CPU's that don't have traditional page table
trees, but use software fill TLB's, hashes, or other things in hardware.

> Whether or not that is a good idea is another issue entirely, however,
> on some level it would make sense to separate protection from all the
> other VM things...

I think that the current Linux approach is much superior - the page tables
are conceptually a separate shadow data structure, but the way things are
set up, you can choose to make the mapping from the shadow data structure
to the actual hardware data structures be a 1:1 mapping.

This does mean that we do NOT want to make the Linux shadow page tables
contain stuff that is not easy to translate to hardware page tables.
Tough. It's a trade-off: either you overspecify the kernel page tables
(and take the hit of having to keep two separate page tables), or you say
"the kernel page tables are weaker than we could make them", and you get
the optimization of being able to "fold" them on top of the hardware page
tables.

I'm 100% convinced that the Linux VM does the right choice - we optimize
for the important case, and I will claim that it is _really_ hard for
anybody to make a VM that is as efficient and as fast as the Linux one.

Proof: show me a full-fledged VM setup that even comes _close_ in
performance, and gives the protection and the flexibility that the Linux
one does.

And yes, we do have _another_ shadow data structure too. It's called the
vm_area_struct, aka "vma", and we do not artificially limit ourself to
trying to look like hardware on that one.

Which brings us back to the original question, and answers it: we already
do all of this, and we do it RIGHT. We optimize for the right things.

		Linus


  parent reply	other threads:[~2001-08-10 23:26 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-04 15:43 /proc/<n>/maps getting _VERY_ long Chris Wedgwood
2001-08-05  2:17 ` Rik van Riel
2001-08-05  5:12   ` Chris Wedgwood
2001-08-05 13:06     ` Alan Cox
2001-08-05 13:18       ` Chris Wedgwood
2001-08-05 23:07       ` Jakob Østergaard
2001-08-05 23:41       ` Linus Torvalds
2001-08-06  0:41         ` Michael H. Warfield
2001-08-06  1:01           ` Linus Torvalds
2001-08-06  1:17             ` H. Peter Anvin
2001-08-06  4:26               ` Linus Torvalds
2001-08-06  6:30                 ` H. Peter Anvin
2001-08-06 18:41                 ` Jamie Lokier
2001-08-10 21:55                   ` Linus Torvalds
2001-08-10 22:00                     ` H. Peter Anvin
2001-08-10 23:03                       ` Nicolas Pitre
2001-08-10 23:26                       ` Linus Torvalds [this message]
2001-08-10 23:55                         ` Rik van Riel
2001-08-11  1:04                     ` Pavel Machek
2001-08-06 11:52               ` Alan Cox
2001-08-06 12:23                 ` Chris Wedgwood
2001-08-06 13:17                   ` Alan Cox
2001-08-06 13:55                     ` Chris Wedgwood
2001-08-06  9:43         ` [LONGish] Brief analysis of VMAs (was: /proc/<n>/maps getting _VERY_ long) Chris Wedgwood
2001-08-05  6:44 /proc/<n>/maps getting _VERY_ long David Luyer
2001-08-05  7:21 ` Anders Eriksson

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.33.0108101618270.1045-100000@penguin.transmeta.com \
    --to=torvalds@transmeta.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lk@tantalophile.demon.co.uk \
    /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).