This was the last major obstacle in being able to
manage virtual memory maps. Object caches are
custom allocators that allow for more fine-grained
allocation policies, including being able to use
memory from the DMAP region.
This is primarily for the slab allocator update
that's about to come, but to be completely tbh
not even i myself am sure what i should include
here because i made a longer break and there are
like 40 modified files that are all interlinked.
This is hopefully the last time in a while that
something in the mm subsystem needs a refactor
this large. There are two main changes:
- The page frame allocator returns a vm_page_t
rather than a virtual address.
- Data for the slab allocator is now stored in
struct vm_page, which means there is no overhead
in the slab itself so the space is used in a
more efficient manner.
This is the final part of the major mm subsystem
refactor (for now). The new and improved slab
allocator can do *proper* poisoning, with pretty
accurate out-of-bounds and use-after-free
detection.
vm_page_t has also been restructured; its flags
and order are now combined into one atomic field.
This is part 3 of the mm subsystem overhaul.
The allocator doesn't rely on mutexes anymore and
uses individual per-order spinlocks instead.
Also, it is aware of multiple memory zones (normal
and DMA) as well as emergency reserves.
Page bitmaps take up 50 % less overhead now.
Another one of those larger endeavours that take
multiple commits. This first one introduces the
basic vm_page data structure, as well as the x86
bootstrap code for initializing it.
As of now, everything except the code imported
from FreeBSD is proprietary. Of course, it won't
be like this for long, only until we have decided
which license we like to use. The rationale is
that releasing everything under a copyleft license
later is always easier than doing so immediately
and then changing it afterwards.
Naturally, any changes made before this commit are
still subject to the terms of the CNPL.
This has been brewing for quite some time now, and
it still is nowhere near finished, but at least it
compiles now. A lot has changed, and it's still
quite messy (i386 is almost certainly broken now,
i haven't even checked)
This seems like a huge commit but it's really just
renaming a bunch of symbols. The entire mm
subsystem is probably gonna have to go through
some major changes in the near future, so it's
best to start off with something that is not too
chaotic i guess.
That's it, nothing major is gonna happen anymore
until i get amd64 support working and deprecate
the entire i386 branch. 32-bit just adds so many
extra complications to memory management that i
don't want to waste any more energy on this
platform which is obsolete anyway.
kqueues are going to form the basis for anything
related to I/O and IPC. They are a lock-free,
atomic FIFO queue and support multiple emitters
and consumers.
Up to now, the page frame allocator's
initialization routine relied on the fact that
map_page() never needs to get new pages on i386 if
the mapped page is a hugepage. This is not at all
true on other architectures, however.
This also includes a minor refactor of everything,
as well as some optimizations. The bitmap
operations have been moved into a separate file
because they are probably gonna come in handy in
other parts of the system as well.