Page MenuHomeFreeBSD

powerpc: Merge all pmap struct definitions
ClosedPublic

Authored by jhibbits on May 1 2019, 3:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 21 2023, 12:59 PM
Unknown Object (File)
Dec 20 2023, 1:16 AM
Unknown Object (File)
Nov 25 2023, 7:28 AM
Unknown Object (File)
Nov 12 2023, 10:49 AM
Unknown Object (File)
Nov 7 2023, 7:17 AM
Unknown Object (File)
Oct 27 2023, 9:58 AM
Unknown Object (File)
Oct 9 2023, 9:45 AM
Unknown Object (File)
Oct 6 2023, 6:13 AM
Subscribers

Details

Summary

A few ports fail to build due to missing pmap definitions, which are
specific per-pmap type. This tries to appease those ports, by merging all pmaps
together. It can probably be cleaned up a bit more, but this is a working first
pass.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Overall this change looks good to me, but I'm worried with the union of structs parts (see comment below).

Do you have an idea of what is the size of pmap and md_page structs on BOOKE and on AIM?
Could this change incur a significant overhead on memory usage?

sys/powerpc/include/pmap.h
153 ↗(On Diff #56894)

I'm concerned about the parts of this change that use union of structs instead of ifdefs. For instance, at this point, even if I'm not on a BOOKE, my pmap objects must be big enough to hold BOOKE fields, right? Wouldn't we be wasting memory with this approach? Couldn't the union be replaced with an ifdef, inside a single pmap struct definition?

The 64-bit Book-E pmap overhead is around 32kB (12 bits worth of PP2D_NENTRIES, so 4096 8-byte entries), and 4kB on 32-bit. This is not small by any stretch, and I do want to rework it, and plan to over the next couple months. For now I can #ifdef within the union (I do want to keep it a union, so that we can eventually have a GENERIC that boots on both AIM and Book-E).

sys/powerpc/include/pmap.h
153 ↗(On Diff #56894)

We could, but that almost defeats the purpose of this exercise, which is to let those ports that need access to kernel data structures to have access to those structures without having to specify AIM or BOOKE. On my list of things to do is also to rework the Book-E pmap layer to not have as much stuff inline for just this reason.

The 64-bit Book-E pmap overhead is around 32kB (12 bits worth of PP2D_NENTRIES, so 4096 8-byte entries), and 4kB on 32-bit. This is not small by any stretch, and I do want to rework it, and plan to over the next couple months. For now I can #ifdef within the union (I do want to keep it a union, so that we can eventually have a GENERIC that boots on both AIM and Book-E).

Ok, I see your point, thanks for fetching the overhead data. Then it should ok to go ahead, with the #ifdef's for now, until the rework is done and it can be removed.

This revision is now accepted and ready to land.May 3 2019, 2:06 PM
This revision was automatically updated to reflect the committed changes.