linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Isaacson <adi@hexapodia.org>
To: John Richard Moser <nigelenki@comcast.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Why does the kernel need a gig of VM?
Date: Fri, 28 Jan 2005 17:32:31 -0800	[thread overview]
Message-ID: <20050129013231.GA12446@hexapodia.org> (raw)
In-Reply-To: <41FA9B37.1020100@comcast.net>

On Fri, Jan 28, 2005 at 03:06:15PM -0500, John Richard Moser wrote:
> Can someone give me a layout of what exactly is up there?  I got the
> basic idea
> 
> K 4G
> A 3G
> A 2G
> A 1G
> 
> App has 3G, kernel has 1G at the top of VM on x86 (dunno about x86_64).
> 
> So what's the layout of that top 1G?  What's it all used for?  Is there
> some obscene restriction of 1G of shared memory or something that gets
> mapped up there?

By default, the bottom 1G of physical memory is mapped into the 1G of
KVA.  (If you have less than 1G, it's all mapped.)  Thus, the TLB
remains valid across the user/kernel switch, which makes system calls
much faster.

The 4G/4G patches (google for the lwn.net overview) change this,
introducing a TLB flush on every syscall.  Better for some things
because you get more VA space, worse for most things because it's
slower.  (But it's "lots better for a few" versus "a little worse for
everybody", so the tradeoff is often worthwhile.) [1]

So the answer to your question is, "What's up there?  Memory.  All of it."
(Until you get to highmem.)

[1] The 4G/4G patch's *primary* goal is to increase the amount of KVA
    available to allow more "struct page" entries without exhausting
    lowmem.  Trying to manage 32GB or 64GB of physical memory with only
    896MB of lowmem is very difficult.  It has the additional advantage
    of allowing userland to mmap almost 4GB of stuff (as compared to
    almost 3GB without 4G/4G) which can be a nice win for database-type
    apps.

-andy

      parent reply	other threads:[~2005-01-29  1:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-28 20:06 Why does the kernel need a gig of VM? John Richard Moser
2005-01-28 20:42 ` Josh Boyer
2005-01-28 20:48   ` John Richard Moser
2005-02-01 15:15     ` Bill Davidsen
2005-01-28 21:42   ` Oliver Neukum
2005-01-28 20:44 ` Chris Friesen
2005-01-29  1:32 ` Andy Isaacson [this message]

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=20050129013231.GA12446@hexapodia.org \
    --to=adi@hexapodia.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nigelenki@comcast.net \
    /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).