]> git.ipfire.org Git - thirdparty/bird.git/commit
Multipage allocation
authorMaria Matejka <mq@ucw.cz>
Wed, 8 Sep 2021 09:29:49 +0000 (11:29 +0200)
committerMaria Matejka <mq@ucw.cz>
Wed, 13 Oct 2021 17:01:22 +0000 (19:01 +0200)
commit6cd37713781a3092f8166b2178fae35cbfec1e28
treed80aaadbbd0b39765f6284229420dea754618c45
parent3a31c3aad6c53ea9673743f983e13728d8551149
Multipage allocation

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)".
doc/bird.sgml
lib/resource.c
lib/slab.c
sysdep/unix/alloc.c
sysdep/unix/main.c