From 2a463e3e26b922a94f2e9a7aaa5c99b69d83ec45 Mon Sep 17 00:00:00 2001 From: Konrad Sztyber Date: Fri, 17 Mar 2023 11:45:27 +0100 Subject: [PATCH] test/json_config: detach virtio controllers before shutdown If the controllers are left attached when the application is terminated, the virtio library might receive notifications about memory being unregistered from the mem_map. The apps in json_config test are preallocating 1GB of memory, which should stop DPDK from releasing the hugepages back to the system, but if they allocate more, that extra pages can be released, which would generate the mem_map notifications . This actually happened in #2951 - spdk_tgt was built with ocf support, which preallocates an extra ~300MB mempools, exceeding 1GB, which caused mem_map notifications to be sent when iscsi mempools were destroyed triggering an assertion in virtio. Another option to fix this would be to increase the size of the preallocated memory, but detaching the controllers achieves the same thing without requiring more resources. Fixes #2951. Signed-off-by: Konrad Sztyber Change-Id: I743af39acfee68caba55ec4fccd593a696ab688b Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17265 Reviewed-by: Karol Latecki Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- test/json_config/json_config.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/json_config/json_config.sh b/test/json_config/json_config.sh index f122dab0f..ec69c2fa1 100755 --- a/test/json_config/json_config.sh +++ b/test/json_config/json_config.sh @@ -362,6 +362,10 @@ function json_config_test_fini() { local ret=0 if [[ -n "${app_pid[initiator]}" ]]; then + if [[ $SPDK_TEST_VHOST_INIT -eq 1 ]]; then + initiator_rpc bdev_virtio_detach_controller VirtioScsiCtrlr0 || : + initiator_rpc bdev_virtio_detach_controller VirtioBlk0 || : + fi killprocess ${app_pid[initiator]} fi