From a990a2e4930014f025338d8ce186abfa12ec09ff Mon Sep 17 00:00:00 2001 From: Andrew Yourtchenko Date: Mon, 18 Mar 2019 10:49:56 +0100 Subject: vnet: disable the expansion of the heap allocated for classifier tables Classifier data structures assume the contiguous chunk of memory within the heap. Default heap flags for dlmalloc allow for heap growth. When that happens, the memory becomes discontiguous. This results in symptoms that are more cryptic than necessary. Disabling the expand makes the session allocation behavior of the classifier the same for dlmalloc as for the legacy allocator. Change-Id: I2f725b5f78a31a8eaa5f5a20dfdd7e1129662f6a Signed-off-by: Andrew Yourtchenko --- src/vnet/classify/vnet_classify.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/vnet/classify/vnet_classify.c') diff --git a/src/vnet/classify/vnet_classify.c b/src/vnet/classify/vnet_classify.c index c4f0c1ff7f6..d8a5a45e252 100644 --- a/src/vnet/classify/vnet_classify.c +++ b/src/vnet/classify/vnet_classify.c @@ -144,6 +144,8 @@ vnet_classify_new_table (vnet_classify_main_t * cm, t->mheap = mheap_alloc (0 /* use VM */ , memory_size); #else t->mheap = create_mspace (memory_size, 1 /* locked */ ); + /* classifier requires the memory to be contiguous, so can not expand. */ + mspace_disable_expand (t->mheap); #endif vec_validate_aligned (t->buckets, nbuckets - 1, CLIB_CACHE_LINE_BYTES); -- cgit 1.2.3-korg