From: Owen Hilyard <ohilyard@iol.unh.edu>
To: David Marchand <david.marchand@redhat.com>
Cc: dev <dev@dpdk.org>, dpdklab <dpdklab@iol.unh.edu>,
Gaetan Rivet <grive@u256.net>,
Jerin Jacob Kollanukkaran <jerinj@marvell.com>
Subject: Re: [dpdk-dev] Memory leak in rte_pci_scan
Date: Mon, 14 Jun 2021 16:41:34 -0400 [thread overview]
Message-ID: <CAHx6DYBqef4kFn1_v9XDnbsFHeacgUmqS1mqjZvCnQuzf3Zunw@mail.gmail.com> (raw)
In-Reply-To: <CAJFAV8xd0onwapO7CaedrAjMee3fwPfkx5TTQJwLjU+p1wAx0w@mail.gmail.com>
From what I've seen so far, that fixes the PCI leak. That just leaves a few
other places. I'll try to get the complete list to you tomorrow, since
running the full set of unit tests takes quite a few hours when ASAN is
involved.
On Mon, Jun 14, 2021 at 6:30 AM David Marchand <david.marchand@redhat.com>
wrote:
> On Mon, Jun 14, 2021 at 11:11 AM David Marchand
> <david.marchand@redhat.com> wrote:
> >
> > On Tue, Jun 8, 2021 at 8:48 PM Owen Hilyard <ohilyard@iol.unh.edu>
> wrote:
> > >
> > > Hello All,
> > >
> > > As part of the community lab's work to deploy static analysis tools,
> we've
> > > been doing test runs of the various tools. One of the problems we
> found is
> > > that rte_pci_scan leaks 214368 Bytes every time it is run. There are
> also
> >
> > I suspect the "leak" is on pci device objects that are not released
> > unless hot(un)plugging.
> > Cc: Gaetan.
>
> I think I found a leak at:
> https://git.dpdk.org/dpdk/tree/drivers/bus/pci/linux/pci.c#n333
>
> For devices with no kernel driver, 'dev' will be leaked, since there
> is no reference to it in the pci device list.
>
> There will be more things to fix (there is a proposed patch on
> annotating the dpdk memory allocator for ASAN) but can you try this
> diff below with the mp patch [1] I sent to see if the situation gets
> better?
>
> diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c
> index 0dc99e9cb2..5ea76bc867 100644
> --- a/drivers/bus/pci/linux/pci.c
> +++ b/drivers/bus/pci/linux/pci.c
> @@ -331,7 +331,7 @@ pci_scan_one(const char *dirname, const struct
> rte_pci_addr *addr)
> else
> dev->kdrv = RTE_PCI_KDRV_UNKNOWN;
> } else {
> - dev->kdrv = RTE_PCI_KDRV_NONE;
> + free(dev);
> return 0;
> }
> /* device is valid, add in list (sorted) */
>
>
> 1:
> http://patchwork.dpdk.org/project/dpdk/patch/20210614091213.3953-1-david.marchand@redhat.com/
>
> --
> David Marchand
>
>
next prev parent reply other threads:[~2021-06-14 20:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-08 18:47 Owen Hilyard
2021-06-14 9:11 ` David Marchand
2021-06-14 10:30 ` David Marchand
2021-06-14 20:41 ` Owen Hilyard [this message]
2021-06-15 7:43 ` David Marchand
2021-06-15 15:15 ` Owen Hilyard
2021-06-16 9:37 ` David Marchand
[not found] ` <CAHx6DYAADd4b9U8m7hNk0d_KkxgYuLF7_ntf+q57tE39W0H2bQ@mail.gmail.com>
2021-06-16 17:40 ` David Marchand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAHx6DYBqef4kFn1_v9XDnbsFHeacgUmqS1mqjZvCnQuzf3Zunw@mail.gmail.com \
--to=ohilyard@iol.unh.edu \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=dpdklab@iol.unh.edu \
--cc=grive@u256.net \
--cc=jerinj@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).