1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

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)".
This commit is contained in:
Maria Matejka
2021-09-08 11:29:49 +02:00
parent 3a31c3aad6
commit 6cd3771378
5 changed files with 62 additions and 4 deletions

View File

@@ -61,7 +61,6 @@ pool root_pool;
void *alloc_sys_page(void);
void free_sys_page(void *);
void resource_sys_init(void);
static int indent;
@@ -283,7 +282,6 @@ rlookup(unsigned long a)
void
resource_init(void)
{
resource_sys_init();
root_pool.r.class = &pool_class;
root_pool.name = "Root";
init_list(&root_pool.inside);