summaryrefslogtreecommitdiff
path: root/lib/mempool.c
AgeCommit message (Collapse)Author
2023-05-06Linpool state save and restore refactoringMaria Matejka
2023-05-03Allocation from linpools and slabs requires the appropriate lock to be takenMaria Matejka
2023-05-03Linpool flushes unused pages even on lp_restore()Maria Matejka
2023-04-14Merge commit '6c058ae4' into thread-next-ifaceMaria Matejka
2023-04-04Resource dumps also write out block addressesMaria Matejka
2023-04-04Linpool: State restoration works in initial linpool stateMaria Matejka
2023-02-22Linpool flush drops all the allocated pages but oneMaria Matejka
When a linpool is used to allocate a one-off big load of memory, it makes no sense to keep that amount of memory for future use inside the linpool. Contrary to previous implementations where the memory was directly free()d, we now use the page allocator which has an internal cache which keeps the released pages for us and subsequent allocations simply get these released pages back. And even if the page cleanup routine kicks in inbetween, the pages get only madvise()d, not munmap()ed so performance aspects are negligible. This may fix some memory usage peaks in extreme cases.
2022-05-04Explicit definition structures of route attributesMaria Matejka
Changes in internal API: * Every route attribute must be defined as struct ea_class somewhere. * Registration of route attributes known at startup must be done by ea_register_init() from protocol build functions. * Every attribute has now its symbol registered in a global symbol table defined as SYM_ATTRIBUTE * All attribute ID's are dynamically allocated. * Attribute value custom formatting hook is defined in the ea_class. * Attribute names are the same for display and filters, always prefixed by protocol name. Also added some unit testing code for filters with route attributes.
2022-04-06All linpools use pages to allocate regular blocksMaria Matejka
2022-03-09Linpools with pages fixed to the final page allocator versionMaria Matejka
2022-03-09Merge commit '0c59f7ff' into haugesundMaria Matejka
2022-03-02Introducing an universal temporary linpool flushed after every taskMaria Matejka
2021-11-27Memory statistics split into Effective and OverheadMaria Matejka
This feature is intended mostly for checking that BIRD's allocation strategies don't consume much memory space. There are some cases where withdrawing routes in a specific order lead to memory fragmentation and this output should give the user at least a notion of how much memory is actually used for data storage and how much memory is "just allocated" or used for overhead. Also raising the "system allocator overhead estimation" from 8 to 16 bytes; it is probably even more. I've found 16 as a local minimum in best scenarios among reachable machines. I couldn't find any reasonable method to estimate this value when BIRD starts up. This commit also fixes the inaccurate computation of memory overhead for slabs where the "system allocater overhead estimation" was improperly added to the size of mmap-ed memory.
2021-10-13Linpools may use pages instead of xmallocMaria Matejka
2017-12-13Lib: Minor fixOndrej Zajicek (work)
2017-12-12Lib: Save/restore state for linpoolsOndrej Zajicek (work)
Also change linpool.current ptr to really point to thr current chunk.
2017-05-16Linpool: default allocation sizeJan Moskyto Matejka
2015-06-08unsigned [int] -> uintPavel TvrdĂ­k
2014-04-14Fixed bug in unused function.Ondrej Filip
2010-06-02Implements command that shows memory usage.Ondrej Zajicek
2009-09-17Fixes headers for uintptr_t (and build on NetBSD).Ondrej Zajicek
2009-09-04Clear memory allocated by ralloc().Ondrej Zajicek
This also fixes bug that timer->recurrent was not cleared in tm_new() and unexpected recurrence of startup timer in BGP confused state machine and caused crash.
2009-07-06Fixes memory alignment problems on Sparc64.Ondrej Zajicek
Not quite standard construction, i should add some autoconf macro. Not tested yet.
2004-06-01ALIGN -> BIRD_ALIGNOndrej Filip
2001-01-17Bug fix from Zheng Yuan <zyuan1@cig.mot.com>.Martin Mares
2000-06-05Documented memory resources.Martin Mares
2000-05-08Implemented debugging function rlookup() which you can call from gdbMartin Mares
to see what resource does the address given as a parameter belong to.
2000-03-31Include "lib/string.h" instead of <string.h>. It should give us bzero()Martin Mares
and other non-portable functions on all systems.
1999-10-29Simplify handling of free chunks.Martin Mares
1999-10-02Don't forget to free large blocks.Martin Mares
1999-03-29Clarify resource dumps and include them in the main debugging dump.Martin Mares
1999-03-29Added lp_flush() which flushes contents of a linear pool, leaving all theMartin Mares
memory available for subsequent allocations from the same pool. Both flushing and re-using the memory costs just few instructions.
1998-12-06Name cleanups as suggested by Pavel:Martin Mares
- cfg_strcpy() -> cfg_strdup() - mempool -> linpool, mp_* -> lp_* [to avoid confusion with memblock, mb_*] Anyway, it might be better to stop ranting about names and do some *real* work.
1998-05-24Staticized some variables and functions.Martin Mares
1998-05-03BIRD library: The story continues.Martin Mares
Complete resource manages and IP address handling.