Message ID | 20200428235827.15383-1-stephen@networkplumber.org (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E6DF6A00BE; Wed, 29 Apr 2020 01:58:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6050B1D65D; Wed, 29 Apr 2020 01:58:38 +0200 (CEST) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by dpdk.org (Postfix) with ESMTP id A80291D659 for <dev@dpdk.org>; Wed, 29 Apr 2020 01:58:36 +0200 (CEST) Received: by mail-pl1-f196.google.com with SMTP id t7so142836plr.0 for <dev@dpdk.org>; Tue, 28 Apr 2020 16:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4RG6P3MUelS9RKkML7ABcHxgbhqUCbw54Vyhr+1b0pY=; b=A+9poICQ70OUTW9tocD/3M6EG/Daqn41TZjmFFc36lf+FZQzQsko+PyKheRFGM91rh Sf7P8svr9lYhZOcOrq1grFbrBgRgeLItTo4TXWf6zlBMB5yb+CaAMXWU4EQpQTfXURrQ NmVDGRc+fWWAEOIHX+7G/7ck9h/xkotZUM2ngjglS8UG5zNhZj++02/XNjVZD9yGqd65 ygv6yz+TrF+yuPy62TpkAPWtFY4j2sUB7hOCVjTFRgMImG9Qgsu+BiXN433PlrcgcFI2 JYsScXA425FBXlsmJ4DxnU3OPYpmgUqgOeQN1lLITDs+Wv3xEDWilAbhcI2w1RyB0J2e 85hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4RG6P3MUelS9RKkML7ABcHxgbhqUCbw54Vyhr+1b0pY=; b=Js8jkkxmhYEynYRDKhPRb0JvGZ5/gRorl/PkRVR74ZmxUCpAJOXSoJgkQbTAnoPhQy wnyxU3GXG3JJMYJj+JtJ6X6oQzFKh7C9YRvusVpRXojFIR9kSJz1iwajHIFxki5jx5Lj lwbI7kflBhmYbLvv5nN8ZpvT6FmNkCDKun9Bnj3/IKL0FWUpDT1RJqU+Es/OLh97KmH7 7rqIv6GEf3E8ZmXO+eozY4S2e8PgzopfoFRgylJ31uawFnZglBSCujDHD73oS8Ge/8tj HM1yK4JFXlmjIhHqfXzmVoO6cqe6JPUyKWl6kbzf0xw7VMtRqnczSA1ZBfG+JLm1kUPm cNmg== X-Gm-Message-State: AGi0PuZiBi78Uc0sXa5zKPCpbJ+qr7s3CMs6Pcy5pbDoa79u2mtcRKmE Ws38xl026sQ6iMw8GDi/sT6RIt1FpWe5og== X-Google-Smtp-Source: APiQypLRwtQKxLsY1cChEq9xO2dK5Z+tYXY/WUtIM/oxxej2GJP0uT44y7M3Fz5udqXEnGuhXDcxJQ== X-Received: by 2002:a17:90a:8c83:: with SMTP id b3mr4788pjo.141.1588118315122; Tue, 28 Apr 2020 16:58:35 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id h193sm16209471pfe.30.2020.04.28.16.58.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Apr 2020 16:58:34 -0700 (PDT) From: Stephen Hemminger <stephen@networkplumber.org> To: dev@dpdk.org Cc: Stephen Hemminger <stephen@networkplumber.org> Date: Tue, 28 Apr 2020 16:58:19 -0700 Message-Id: <20200428235827.15383-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200104013341.19809-1-stephen@networkplumber.org> References: <20200104013341.19809-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 0/8] eal: cleanup resources on shutdown X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Series |
eal: cleanup resources on shutdown
|
|
Message
Stephen Hemminger
April 28, 2020, 11:58 p.m. UTC
Started using valgrind with DPDK, and there are lots of leftover memory and file descriptors. This makes it hard to find application leaks versus 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 are no new exposed API or ABI changes here. 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 (8): eal: log: close on cleanup eal: log: free dynamic state on cleanup eal: alarm: close file on cleanup eal: cleanup threads 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/librte_eal/common/eal_common_log.c | 33 ++++++++++++++++++++++++- lib/librte_eal/common/eal_common_proc.c | 17 +++++++++---- lib/librte_eal/common/eal_private.h | 20 +++++++++++++++ lib/librte_eal/common/hotplug_mp.c | 5 ++++ lib/librte_eal/common/hotplug_mp.h | 6 +++++ lib/librte_eal/common/malloc_heap.c | 6 +++++ lib/librte_eal/common/malloc_heap.h | 3 +++ lib/librte_eal/common/malloc_mp.c | 12 +++++++++ lib/librte_eal/common/malloc_mp.h | 3 +++ lib/librte_eal/freebsd/eal.c | 1 + lib/librte_eal/freebsd/eal_alarm.c | 10 ++++++++ lib/librte_eal/linux/eal.c | 20 +++++++++++++++ lib/librte_eal/linux/eal_alarm.c | 11 +++++++++ lib/librte_eal/linux/eal_log.c | 14 +++++++++++ lib/librte_eal/linux/eal_vfio.h | 1 + lib/librte_eal/linux/eal_vfio_mp_sync.c | 8 ++++++ 16 files changed, 164 insertions(+), 6 deletions(-)
Comments
On Wed, Apr 29, 2020 at 1:58 AM Stephen Hemminger <stephen@networkplumber.org> wrote: > > Started using valgrind with DPDK, and there are lots of leftover > memory and file descriptors. This makes it hard to find application > leaks versus 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 are no new exposed API or ABI changes here. > > 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 Same segfault as v1. $ ./devtools/test-null.sh ./build/app/dpdk-testpmd 0x3 --plop ./build/app/dpdk-testpmd: unrecognized option '--plop' EAL: Detected 8 lcore(s) EAL: Detected 1 NUMA nodes Usage: ./build/app/dpdk-testpmd [options] (snip) EAL: FATAL: Invalid 'command line' arguments. EAL: Invalid 'command line' arguments. EAL: Error - exiting with code: 1 Cause: Cannot init EAL: Invalid argument ./devtools/test-null.sh: line 32: 23134 Broken pipe ( sleep 1 && echo stop ) 23135 Segmentation fault (core dumped) | $testpmd -c $coremask --no-huge -m 20 $libs -w 0:0.0 --vdev net_null1 --vdev net_null2 $eal_options -- --no-mlockall --total-num-mbufs=2048 $testpmd_options -ia
That's a pity this patchset is not concluded. Please Stephen, could you respin with a fix? 03/05/2020 19:21, David Marchand: > On Wed, Apr 29, 2020 at 1:58 AM Stephen Hemminger > <stephen@networkplumber.org> wrote: > > > > Started using valgrind with DPDK, and there are lots of leftover > > memory and file descriptors. This makes it hard to find application > > leaks versus 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 are no new exposed API or ABI changes here. > > > > 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 > > Same segfault as v1. > > $ ./devtools/test-null.sh ./build/app/dpdk-testpmd 0x3 --plop > ./build/app/dpdk-testpmd: unrecognized option '--plop' > EAL: Detected 8 lcore(s) > EAL: Detected 1 NUMA nodes > > Usage: ./build/app/dpdk-testpmd [options] > > (snip) > > EAL: FATAL: Invalid 'command line' arguments. > EAL: Invalid 'command line' arguments. > EAL: Error - exiting with code: 1 > Cause: Cannot init EAL: Invalid argument > ./devtools/test-null.sh: line 32: 23134 Broken pipe ( > sleep 1 && echo stop ) > 23135 Segmentation fault (core dumped) | $testpmd -c > $coremask --no-huge -m 20 $libs -w 0:0.0 --vdev net_null1 --vdev > net_null2 $eal_options -- --no-mlockall --total-num-mbufs=2048 > $testpmd_options -ia > > >
Ping 20/10/2020 00:24, Thomas Monjalon: > That's a pity this patchset is not concluded. > Please Stephen, could you respin with a fix? > > > 03/05/2020 19:21, David Marchand: > > On Wed, Apr 29, 2020 at 1:58 AM Stephen Hemminger > > <stephen@networkplumber.org> wrote: > > > > > > Started using valgrind with DPDK, and there are lots of leftover > > > memory and file descriptors. This makes it hard to find application > > > leaks versus 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 are no new exposed API or ABI changes here. > > > > > > 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 > > > > Same segfault as v1. > > > > $ ./devtools/test-null.sh ./build/app/dpdk-testpmd 0x3 --plop > > ./build/app/dpdk-testpmd: unrecognized option '--plop' > > EAL: Detected 8 lcore(s) > > EAL: Detected 1 NUMA nodes > > > > Usage: ./build/app/dpdk-testpmd [options] > > > > (snip) > > > > EAL: FATAL: Invalid 'command line' arguments. > > EAL: Invalid 'command line' arguments. > > EAL: Error - exiting with code: 1 > > Cause: Cannot init EAL: Invalid argument > > ./devtools/test-null.sh: line 32: 23134 Broken pipe ( > > sleep 1 && echo stop ) > > 23135 Segmentation fault (core dumped) | $testpmd -c > > $coremask --no-huge -m 20 $libs -w 0:0.0 --vdev net_null1 --vdev > > net_null2 $eal_options -- --no-mlockall --total-num-mbufs=2048 > > $testpmd_options -ia > > > > > > > > > > > >