From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0A149A0C4B; Sat, 13 Nov 2021 04:32:16 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9669340691; Sat, 13 Nov 2021 04:32:15 +0100 (CET) Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by mails.dpdk.org (Postfix) with ESMTP id 4A1284013F for ; Sat, 13 Nov 2021 04:32:14 +0100 (CET) Received: by mail-pj1-f53.google.com with SMTP id gf14-20020a17090ac7ce00b001a7a2a0b5c3so8476510pjb.5 for ; Fri, 12 Nov 2021 19:32:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ckQQGVH9XQgC3Sj10b6oOi6qRafFueBieK+1RCUSRvU=; b=o1McAGYxBoCteX8Pm4gE38a3/R7HAXyJQX2xMlWdwi10+FvYV6BZwxWyZFEBoeL1Bd kfC5IQHnKI3S67NLAUt+//0D/+5tE5MG1jZvWjAL7JtufXQIOfByNWC1a/DjdDE4fuAr sUR/nXjWO1QhH69qC6d9Dt+bAVMTbUh/DI0dKMOMEHvhUvpsSIhLFQFzHqaMdOVuMMPv xNfwtYtaVk/58EJnmyyihNHNMPSNVm7TGLWgSgnSGKkszpH32u9aUdFl/3VfqvUURcEz OtFhEWDjcV4G/w+KPOHXn++IO/SGkQNoQ4stlZlCaSeUomVIixcUT3rtbVMoREwb1E3s Myiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ckQQGVH9XQgC3Sj10b6oOi6qRafFueBieK+1RCUSRvU=; b=1b83uJyGq71jBQgp9LRDOuX6rXlcAl7gKsQnnCZErwpJRsoLfoxwxDIY9zhDdE87mK VFTPAOqs5AyiW105L5Tfqjsint0lSKjkREA7iPcMjl6aYGXMxcNqcvHi3RLMw1CSijtJ UAUq+joFuDkJqwv5okXT73I+czesd0boE6FUZ5qBal2p4KX/xe1aX8JWgjL++NikiP7z 96W1f8CYS3+GX7qE6MYIfDAS6+RCwDPRpYc/gt6ZhciAmvoLeaoZgWMK2GspUitzeXeS j0nBfJQTKNsCHYG5CZm5lNkON+7A9n53+PbsFKY/F2AWycWdKqL9E4SJ9BovWxOtnI8C RJFw== X-Gm-Message-State: AOAM530zwP6SE6oQVdotlnlwrgrJkgFSrGLCygPu+AAMjbaMjxJh9V37 KLyDSiaXMpcCBkU6jESS0hF29oLSz2QsvQ== X-Google-Smtp-Source: ABdhPJyuOh9B6a2q7XaaU6mlhVRwaMIiHUJ8fRntTvONmUIx4p2uzq2BzSzGUtA5LGoA94hd5ngGsw== X-Received: by 2002:a17:90a:17a5:: with SMTP id q34mr41710777pja.122.1636774332789; Fri, 12 Nov 2021 19:32:12 -0800 (PST) Received: from hermes.local (204-195-33-123.wavecable.com. [204.195.33.123]) by smtp.gmail.com with ESMTPSA id b9sm5999596pgf.15.2021.11.12.19.32.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Nov 2021 19:32:12 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v5 0/5] cleanup DPDK resources via eal_cleanup Date: Fri, 12 Nov 2021 19:32:04 -0800 Message-Id: <20211113033209.341027-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20200428235827.15383-1-stephen@networkplumber.org> References: <20200428235827.15383-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org When testing using ASAN or valgrind with DPDK; there are lots of leftover memory and file descriptors. This makes it hard to find application leaks versus internal DPDK leaks. The DPDK has a function that applications can use to tell it to cleanup resources on shutdown (rte_eal_cleanup). But the current coverage of that API is spotty. Many internal parts of DPDK leave files and allocated memory behind. This patch set is a first step at getting the sub-parts of DPDK to cleanup after themselves. These are the easier ones, the harder and more critical ones are in the drivers and the memory subsystem. There should be no new exposed API or ABI changes here. v5 - add stub for windows build in rte_malloc cleanup v4 - rebase to 20.11-rc - drop one patch (alarm cleanup is implemented) - drop patch that ends worker threads on cleanup. the test is calling rte_exit/eal_cleanup in a forked process. (could argue this is a test bug)! v3 - fix a couple of minor checkpatch complaints v2 - rebase after 20.05 file renames - incorporate review comment feedback - hold off some of the more involved patches for later Stephen Hemminger (5): eal: close log in eal_cleanup eal: mp: end the multiprocess thread during cleanup eal: vfio: cleanup the mp sync handle eal: hotplug: cleanup multiprocess resources eal: malloc: cleanup mp resources lib/eal/common/eal_common_log.c | 13 +++++++++++++ lib/eal/common/eal_common_proc.c | 20 +++++++++++++++++--- lib/eal/common/eal_private.h | 7 +++++++ lib/eal/common/hotplug_mp.c | 5 +++++ lib/eal/common/hotplug_mp.h | 6 ++++++ lib/eal/common/malloc_heap.c | 6 ++++++ lib/eal/common/malloc_heap.h | 3 +++ lib/eal/common/malloc_mp.c | 12 ++++++++++++ lib/eal/common/malloc_mp.h | 3 +++ lib/eal/linux/eal.c | 7 +++++++ lib/eal/linux/eal_log.c | 8 ++++++++ lib/eal/linux/eal_vfio.h | 1 + lib/eal/linux/eal_vfio_mp_sync.c | 8 ++++++++ lib/eal/windows/eal_mp.c | 7 +++++++ 14 files changed, 103 insertions(+), 3 deletions(-) -- 2.30.2