From 0d31b9cb9f069f70592a83f95a7e63fab79719f6 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Sat, 8 May 2021 15:29:50 -0700 Subject: svm: try chunk alloc only if enough space available Type: fix Signed-off-by: Florin Coras Change-Id: I3c52dd783601d50e981f75bd05a7b95c03bb5c22 --- src/svm/fifo_segment.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/svm') diff --git a/src/svm/fifo_segment.c b/src/svm/fifo_segment.c index cde906fe799..d8b3b259038 100644 --- a/src/svm/fifo_segment.c +++ b/src/svm/fifo_segment.c @@ -694,7 +694,8 @@ free_list: if (data_bytes <= fss_fl_chunk_bytes (fss) + n_free) { u32 min_size = FIFO_SEGMENT_MIN_FIFO_SIZE; - + if (n_free < min_size) + goto done; batch = (data_bytes - fss_fl_chunk_bytes (fss)) / min_size; batch = clib_min (batch + 1, n_free / min_size); if (fsh_try_alloc_chunk_batch (fsh, fss, 0, batch)) -- cgit 1.2.3-korg