Type: refactor
Rb-trees are no longer maintained in the segment so we don't need to
reserve memory. Keeping the option as a means to avoid underlying infra
(dlmalloc) and alignment overhead.
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I84741e95d015f7b72c60d9dca20be8e0aee6a915
fifo_segment_header_t *fsh;
fifo_segment_slice_t *fss;
ssvm_shared_header_t *sh;
- u32 max_chunk_sz, max_chunks;
+ u32 max_chunk_sz;
uword max_fifo;
void *oldheap;
int i;
fsh->n_free_bytes = fsh_free_space (fsh);
fsh->n_cached_bytes = 0;
- max_chunks = fsh->n_free_bytes / FIFO_SEGMENT_MIN_FIFO_SIZE;
- fsh->n_reserved_bytes = (max_chunks / 4) * sizeof (rb_node_t);
+ fsh->n_reserved_bytes = clib_min (0.01 * fsh->n_free_bytes, 256 << 10);
sh->ready = 1;
return (0);
}