Beelzebub icon indicating copy to clipboard operation
Beelzebub copied to clipboard

Physical memory allocator improvement

Open vercas opened this issue 9 years ago • 4 comments

It is vital that Beelzebub begins to use 2-MiB pages where possible.
These have their own TLBs in L1 and share entries with 4-KiB pages in L2.
Therefore, using 2-MiB pages allows threads and cores to handle significantly larger working sets, which is handy for both the kernel and especially userland.

This requires support from the PMM, which needs to provide aligned pages.

Thus, the following must be implemented:

Plans

  • [x] Simplify and abstract away interface of the PMM; no need for consumers to know every little detail.
    • [ ] Expose simplified PMM to kernel modules.
  • [x] Change physical allocation space to work with 2-MiB frames.
    • [x] Serve 4-KiB frames from within 2-MiB frames. Management structures for the 4-KiB frames should be within the 2-MiB frame.
    • [x] Use frame dangling at the end of the allocation space, if any.
    • [ ] Use frame at the start of the allocation space, if any.

vercas avatar Sep 18 '16 21:09 vercas

This design does not allow lock-free allocation, so the related task was removed from the issue.
It does, however, allow a finer level of locking than the previous design.

Also, working on all features at once. Much easier this way. Will take a while.

vercas avatar Sep 22 '16 06:09 vercas

Rowhammer-proofing is a book-keeping nightmare, and fails when shared memory is involved.
Will not implement.

vercas avatar Sep 26 '16 22:09 vercas

Reference counting is not fully implemented yet.

vercas avatar Oct 13 '16 09:10 vercas

Reference counting is fully implemented.
God help me.

vercas avatar Oct 17 '16 23:10 vercas