LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Noah yan <noah.yan@gmail.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: How the linux use BAT
Date: Sat, 29 Oct 2005 08:39:04 +1000	[thread overview]
Message-ID: <1130539144.29054.119.camel@gaston> (raw)
In-Reply-To: <59521b110510280856y9c39f4by54cadd01830ded07@mail.gmail.com>

On Fri, 2005-10-28 at 10:56 -0500, Noah yan wrote:

>         
> I am sorry that I did make it clear. It is a little confusing for me
> between the hardware segment and the term "segment" or "section" used
> in a process's address space (AS). One of my understanding is that a
> section in a process's AS is mapped to a hardware segment, which sound
> straightforward but maybe wrong because a process binary may have lots
> of segments that are not the same size. 

No, there is no relationship. The kernel just sets up enough segments to
map the entire process address space, this is irrelevant to the actual
program sections.

> Pure segment VM is also hard to maintain memory efficiency.  Or,
> several sections, such as different data section are in segments. I
> remember in Linux x86 (posibbly 2.4), segment is not fully used in
> term of VM. The segmentation of the kernel and userland are defined
> upon booting and never changed later on. 

The segmentation mecanism on PowerPC is slightly different. We change
segments when context switching as they contain the "vsid" which acts as
a kind of context ID, thus we can keep entry for more than one
context/process in the hash table, we don't have to flush it on context
switches.

> Thanks very much!
> Noah
> 
> 
> 
>  
> 
>         The way linux uses BATs is for the kernel linear mapping.
>         Linux uses by
>         default (though that can be configued differently) a 3G/1G
>         split, that 
>         is the low 3G of address space are used by userland (and
>         covered by the
>         user page tables) and the high 1G are used by the kernel. That
>         kernel
>         space itself is split into a bottom part up to 768Mb (by
>         default, that 
>         can also be configured differently) which is the linear
>         mapping, that is
>         a single linear mapping of all RAM from 0xc0000000. The rest
>         of the
>         kernel space is mapped with page tables and known as the
>         kernel virtual 
>         space, used for vmalloc and ioremap.
>         
>         The BATs are used for the linear mapping. They "override" the
>         page
>         tables over it if any (though we usually don't bother setting
>         up PTEs
>         over the space that is BAT mapped). They basically improve
>         performances 
>         by not requiring to go through the hash trasnslation for most
>         kernel
>         accesses to memory and not using space in the TLB/ERAT.
>         
>         Ben.
>         
>         
> 

      reply	other threads:[~2005-10-28 22:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-27 13:05 How the linux use BAT Noah yan
2005-10-27 22:37 ` Benjamin Herrenschmidt
2005-10-28 15:56   ` Noah yan
2005-10-28 22:39     ` Benjamin Herrenschmidt [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=1130539144.29054.119.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=noah.yan@gmail.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