summaryrefslogtreecommitdiff
path: root/sysdep/unix/alloc.c
AgeCommit message (Collapse)Author
2022-02-03Page cleanup routines updated to allow nested birdloopsMaria Matejka
2021-12-07Fixed build errors for OpenBSDMaria Jan Matejka
2021-12-07Fixed standby memory page counters on shutdownMaria Matejka
Bug introduced by commit 38278d94ba0a179d5eeb061a59850a4e1c150e5b.
2021-12-01No memory unmapping when shutting downMaria Matejka
All the memory is just freed implicitly on exit, no need for page-by-page unmapping.
2021-12-01Merge branch 'master' into HEADMaria Matejka
2021-12-01Page allocator moved from pools to IO loops.Maria Matejka
The resource pool system is highly hierarchical and keeping spare pages in pools leads to unnecessarily complex memory management. Loops have a flat hiearchy, at least for now, and it is therefore much easier to keep care of pages, especially in cases of excessive virtual memory fragmentation.
2021-11-24Directly mapped pages are kept for future use if temporarily not neededMaria Matejka
2021-11-23Stored pages release routineMaria Matejka
2021-11-22Keeping un-unmmappable pages until they can be reusedMaria Matejka
On Linux, munmap() may fail with ENOMEM when virtual memory is too fragmented. Working this around by just keeping such blocks for future use.
2021-10-13Multipage allocationMaria Matejka
We can also quite simply allocate bigger blocks. Anyway, we need these blocks to be aligned to their size which needs one mmap() two times bigger and then two munmap()s returning the unaligned parts. The user can specify -B <N> on startup when <N> is the exponent of 2, setting the block size to 2^N. On most systems, N is 12, anyway if you know that your configuration is going to eat gigabytes of RAM, you are almost forced to raise your block size as you may easily get into memory fragmentation issues or you have to raise your maximum mapping count, e.g. "sysctl vm.max_map_count=(number)".
2021-09-10Bound allocated pages to resource pools with page caches to avoid ↵Maria Matejka
unnecessary syscalls
2021-03-25Slab: head now uses bitmask for used/free nodes info instead of listsMaria Matejka
From now, there are no auxiliary pointers stored in the free slab nodes. This led to strange debugging problems if use-after-free happened in slab-allocated structures, especially if the structure's first member is a next pointer. This also reduces the memory needed by 1 pointer per allocated object. OTOH, we now rely on pages being aligned to their size's multiple, which is quite common anyway.