Prior to r329071, pmap_bootstrap() used pmap_kmem_choose() to round the first available virtual address to a 2MB boundary. After r329071, create_pagetables() rounds firstaddr up to a 2MB boundary. Therefore, it is no longer necessary for pmap_bootstrap() to round up to the 2MB boundary again.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/amd64/amd64/pmap.c | ||
---|---|---|
1053 ↗ | (On Diff #39274) | Then assert that the virtual_avail address is aligned on NBPDR. |
sys/amd64/amd64/pmap.c | ||
---|---|---|
1053 ↗ | (On Diff #39274) | We could do that; however, I'm not sure it is really important to do so. As I understand it, the point of this restriction was so the kernel could be in 2MB pages, avoiding the overhead of maintaining 4KB paging structures for this space. However, the last several dozen pages prior to firstaddr are not the kernel, but rather are the first memory allocations made after bootup. I cannot see a reason why it is important to keep these in an isolated 2MB page. I can imagine a future change which would rework some of this and leave some of those allocations in 4KB pages, while keeping the kernel in 2MB pages. With this in mind, is it really important to assert here that the kernel VA space must start on a 2MB page boundary? Is there some other reason it is important that this be invariant? |
sys/amd64/amd64/pmap.c | ||
---|---|---|
1053 ↗ | (On Diff #39274) | Well, you did care to explain that the resulting alignment of subsequent 'raw' allocations did not changed after your patch, as an argumentation for the patch validity. I think it is more important that previous allocation ends up consuming the aligned block, as explained in create_pagetables(). |