Subject: Re: Kernel Exception "Page Not Present"
To: Cherry George Mathew <cherry@sdf.lonestar.org>
From: Marcel Moolenaar <marcel@xcllnt.net>
List: port-ia64
Date: 02/27/2006 10:39:25
--Apple-Mail-1--450391327
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed


On Feb 27, 2006, at 5:56 AM, Cherry George Mathew wrote:

>     Marcel> VHPT itself (i.e.  region 7).  Put differently region 5 is
>     Marcel> where VM managed memory comes from, while region 6 and 7
>     Marcel> are used by the machine dependent implementation to
>     Marcel> support the MI functionality.
>
> I see some nominal savings ( like throwing out ia64_kptedir[] )
> if we just managed everything within RR7. Maybe I don't see something
> critically important here.

You want to be able to page out and page in. You can only do that
effectively if the page replacement algorithm isn't bound by the
1-to-1 mapping between VA and PA. Likewise, certain VM submaps
are defined over a preset VM address range. In a 1-to-1 mapping,
you actually reserve the memory itself rather than reserving the
address range. So, while using direct mapped memory *is* efficient
by its own right, you won't have the flexibility you need for
effective memory management and you end up with a solution that
is less efficient overall.

Another datapoint is that on NUMA architectures you want to be
able to replicate read-only data so that it's close to the CPUs.
Replication is easy if there's a fixed VA range that maps to a
PA range that's near to the CPUs in the cell/node. If you want
to replicate the kernel text, you will have different VA->PA
mappings per cell. Consequently, direct mapped memory is not
working out here as well.

So, while FreeBSD has a couple of places where region 7 addressing
is used, it's better in the long term to move away from that.
I have some thoughts about all of this on the FreeBSD wiki:
	http://wikitest.freebsd.org/moin.cgi/ia64_2fBootLoader

>     Marcel> The advantage of using SKI is that you can set breakpoints
>
> Do you know if ski implements the VHPT walker at all ?

Yes, it implements the VHPT walker.

>     Marcel> I need to dig into the code more before I can be more
>     Marcel> helpful, I fear.
>
> Would you like to have access to CVS ? Or shall I just put everything
> up for download in a tarball release ?

I prefer CVS access. That way I can easily make patches
for illustrative purposes or look at history to understand
why things are the way they are.

>     Marcel> You're in a perfect position right now to switch to 16KB
>     Marcel> pages. Just a thought.
>
> Thats a great tip! Ultimately, I want to go one step ahead, and
> provide true multipage size support, but looking at the rate things
> are going, it may be a while before I get to it :-)

I know what you mean. There's still a lot of work ahead of me in
FreeBSD too. At this time I consider it functional. We're nowhere
near optimal, let alone bug-free. It's a lot of work, but a lot
of fun too :-)

-- 
  Marcel Moolenaar         USPA: A-39004          marcel@xcllnt.net



--Apple-Mail-1--450391327
Content-Transfer-Encoding: base64
Content-Type: application/pkcs7-signature;
	name=smime.p7s
Content-Disposition: attachment;
	filename=smime.p7s

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGIzCCAtww
ggJFoAMCAQICEBoIqfht6tPKS4U52PfxugQwDQYJKoZIhvcNAQEEBQAwYjELMAkGA1UEBhMCWkEx
JTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQ
ZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTA2MDEwOTIwNDgwMVoXDTA3MDEwOTIwNDgw
MVowQzEfMB0GA1UEAxMWVGhhd3RlIEZyZWVtYWlsIE1lbWJlcjEgMB4GCSqGSIb3DQEJARYRbWFy
Y2VsQHhjbGxudC5uZXQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDg6xtoVZhBhyEi
4ZCL/5vnfLguFBijoKXCsS6W9uDPpnIwtePgD4B4hmRvFzmpPDRvkYeq2xSscTPfeyHJxavAoU1M
sOcQ4FO8pr9WNdsXSD96wtjU9HJ9o9oKSl6F7tgPdxbV/lS7qcKSWTgTxjO05eWq4v488avb4DiL
0kYheSZPJ3zv1J6t+MKXlg+c9wIvq6g3MYVnZYOZP1/sjEJRFD7Cw9T3AV7JHVBeVFqoSGEMu2CF
JyYZyqrqI2BPKka88q+1CkjGERhWvjupqZQobLV6P1n9FqIIS5GSTNyxUuGL553sfrFF8bA1cPxY
LoP0i7VXhbpgW5eAvtOrzzKJAgMBAAGjLj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