]> git.ipfire.org Git - thirdparty/bird.git/commit
Memory pages are not munmapped, instead we just madvise()
authorMaria Matejka <mq@ucw.cz>
Tue, 1 Nov 2022 17:40:56 +0000 (18:40 +0100)
committerMaria Matejka <mq@ucw.cz>
Wed, 2 Nov 2022 11:56:54 +0000 (12:56 +0100)
commit9d03c3f56ced3d3191982f57029f9a3d12fa2e5a
treead1fa71442ad21704a99a18653d716b088bb2b78
parent37b644413723670928f6b54f2abe0c852eb0b652
Memory pages are not munmapped, instead we just madvise()

Memory unmapping causes slow address space fragmentation, leading in
extreme cases to failing to allocate pages at all. Removing this problem
by keeping all the pages allocated to us, yet calling madvise() to let
kernel dispose of them.

This adds a little complexity and overhead as we have to keep the
pointers to the free pages, therefore to hold e.g. 1 GB of 4K pages with
8B pointers, we have to store 2 MB of data.
sysdep/cf/linux.h
sysdep/unix/alloc.c