summaryrefslogtreecommitdiff
path: root/src/kernel/malloc.c
AgeCommit message (Collapse)Author
2024-08-17*: getxattrdzwdz
2024-07-25kernel: pass more information to user on interruptdzwdz
This is meant to facilitate a syscall for returning from interrupts, which will actually work in the general case as opposed to the current hack, which only works if the interrupt occured during a syscall (which is correct... for now).
2024-07-17kernel: actually store the tag (and size) in the kmalloc metadatadzwdz
I'm storing more information in less space. Win-win.
2024-07-17kernel: make kmalloc accept a numeric "tag" instead of a freeform descriptiondzwdz
This will both let me save space in the allocation header, and make the debugprint more readable.
2024-07-16kernel: use a slab allocator for kmallocdzwdz
For a while during development it managed to be faster than the old allocator despite having more overhead, probably because it makes better use of the cache. It no longer is - not sure why. The code definitely could be optimized to hell, though, and it'd probably recover its original edge. Non-power-of-2 sizeclasses would be really useful, as I could then e.g. fit four processes into a page instead of three, but I think implementing them "well" would be too complicated for now. In hindsight arbitrary allocation descriptions were probably a bad idea too. I've kept them in for now, but I'll switch to an enum of allocation types soon. I think I can fit all the per-allocation state (size+type) in 2 bytes. There are so few allocations in the kernel that I no longer care about the backtraces, so I'm leaving them out. The "large" allocations could probably be tested with execbuf in userland, so I might actually implement them soon too.
2024-07-15kernel: free list page allocatordzwdz
Yay for guaranteed O(1) insertions, even if iostress seems a bit slower.
2024-07-15kernel: split the page allocator and kmallocdzwdz
2024-07-15kernel: minor malloc tweaks before refactordzwdz
* firstfreepage now updates properly, preventing a crash (oops) * kfree only wipes the length of the allocation, not the entire page - which should make it easier to see the performance impact of the pagealloc changes
2024-07-14kernel/malloc: clean up the code a little bitdzwdz
The bitmap functions now accept page addresses so I don't have to handle raw bitmap indexes, which was kinda complex. kmalloc_sanity is now not visible to other code as it wasn't really that useful in the first place.
2024-07-13kernel/malloc: limit the maximum allocation size to under a pagedzwdz
This will likely be changed back, but for the time being it will let me implement a better allocator without too much effort.
2024-03-13kernel/malloc: slight rework (it's still bad), store more metadatadzwdz
2023-09-07kernel: slightly refactor the page allocatordzwdz
2023-09-06kernel: fix panic with large initrddzwdz
2023-02-22kernel/malloc: fill allocated and freed regions with junkdzwdz
2023-01-25kernel: move /mem/alloc to /malloc and linker.ld to arch/amd64/dzwdz