Page MenuHomeFreeBSD

stand: Move amd64 tramp page table from .data to heap
AcceptedPublic

Authored by imp on Aug 11 2022, 8:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 4 2024, 6:12 AM
Unknown Object (File)
Jan 29 2024, 4:09 PM
Unknown Object (File)
Jan 3 2024, 10:48 PM
Unknown Object (File)
Dec 20 2023, 5:21 AM
Unknown Object (File)
Jun 24 2023, 4:40 AM
Unknown Object (File)
May 2 2023, 8:32 AM
Unknown Object (File)
Apr 7 2023, 9:30 PM
Unknown Object (File)
Mar 5 2023, 5:53 PM
Subscribers

Details

Summary

There's no need that the page table has to be in low memory. Use the 12k
just past the nominal end of kernend for this page table and adjust
kernend for this use. This will ensure that the page table survives
until it's replaced later in boot.

This saves just under 12k of memory in the 640k zone.

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 47357
Build 44244: arc lint + arc unit

Event Timeline

imp requested review of this revision.Aug 11 2022, 8:59 PM

From what I understand, this would waste these three page forever.

In D36144#820638, @kib wrote:

From what I understand, this would waste these three page forever.

Yes. That's true. I'm open to other ways to make the page table safe through the time that we start managing it in hammer_time.

In D36144#820675, @imp wrote:
In D36144#820638, @kib wrote:

From what I understand, this would waste these three page forever.

Yes. That's true. I'm open to other ways to make the page table safe through the time that we start managing it in hammer_time.

I think you can just malloc them in loader. Kernel only consumes the memory directly past the kernel_end during very early bootstrap.

Use malloc'd memory, as suggested by kib

BSS would not had saved us as we do have code, data, bss, stack in low memory.

This revision is now accepted and ready to land.Aug 13 2022, 5:57 AM

Use memalign() to malloc page tables

This revision now requires review to proceed.Sep 13 2022, 4:27 AM
This revision is now accepted and ready to land.Sep 13 2022, 6:30 AM

Turns out malloc / memalign don't work reliably... Need to investigate why more deeply. Maybe I'm not allocating enough space.... but the old allocations were definitely 12k total.