Subject: Re: adventures in pmap
To: None <port-arm@netbsd.org>
From: Chris Gilbert <chris@paradox.demon.co.uk>
List: port-arm
Date: 08/12/2002 09:18:23
----- Original Message -----
From: "Chris Gilbert" <chris@paradox.demon.co.uk>
Sent: Monday, August 12, 2002 3:12 AM


> Evening (or rather morning)
>
> While looking over the pmap code I noticed that every time we fork a
process
> we pretty much bzero most of the 16k L1 table, thinking this was
inefficient
> I decided to fiddle with the code in pmap, mostly with a view to start
work
> on freeing ptp's when we're finished with them, which means that on
process
> exit the only pages in the L1 would be the kernel ones, as the rest are
> pmap_removed, which means that the l1pt will have been cleanded up, and
> wouldn't need to be bzero'd, reducing the process creation overhead
> (especially as most processes have maybe 3 ptp's, so only have 12 entries
in
> the l1pt, so 16k is rather overkill if only 48 bytes had to be cleared.)
>
> However I stumbled at the first block, it seems that some processes
> (savecore, gdb, fsck) are mapping memory in somehow, but not creating a
user
> manged ptp for it, I'm wondering if anyone can suggest how?

Of course given some sleep, I suddenly see what's wrong, a ptp maps 4 x 1MB
sections, IE I think the diff should do:
ptp = pmap_get_ptp(pmap, va & (L1_S_FRAME << 2));

gah, that's what I get for late night hacking 8)

Chris