From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [RFC 0/3] fix bogus interrupt FD leak warnings
Date: Sat, 17 Oct 2026 13:35:02 -0700 [thread overview]
Message-ID: <20261017203621.3136254-1-stephen@networkplumber.org> (raw)
Running testpmd with an i40e device on 26.11-rc1 prints a set of FD
leak warnings on port close and on exit:
Closing ports...
EAL: Some interrupt handle is leaking a FD: 19
EAL: Some interrupt handle is leaking a device FD: 18
Port 0 is closed
...
Bye...
EAL: Some interrupt handle is leaking a FD: 20
EAL: Some interrupt handle is leaking a device FD: 18
EAL: Some interrupt handle is leaking a device FD: 18
EAL: Some interrupt handle is leaking a FD: 7
EAL: Some interrupt handle is leaking a FD: 7
The warning is new in 26.11 (commit d770ee9caed0, "interrupts: warn on
leaked FDs"). It is doing its job - one of these is a real leak - but
most of what it reports here is not, and the noise will get reported as
a regression.
There are three distinct causes.
The interrupt source created by rte_intr_callback_register() keeps a
copy of the caller's handle. The copy carries the caller's fd and
dev_fd, but does not own them, so freeing the source complains about
fds that the caller still holds and will close itself.
The VFIO device fd is closed by dev_vfio_release_device() on unmap,
but is left behind in the interrupt handle, so freeing the handle later
reports an fd that is already closed. The VFIO request handle holds the
same fd and has the same problem.
The alarm timerfd is a real leak: it is never closed on EAL cleanup.
FreeBSD was already fixed for this; Linux was not.
Patches 1 and 2 address the bogus warnings, patch 3 the actual leak.
With all three applied the same testpmd run shuts down cleanly with no
warnings.
Open questions:
- Patch 1 clears the fds in the source's copy of the handle. Clearing
them at dup time, or not duplicating the fds into the source at all,
may be the better fix.
- Patch 2 resets dev_fd at the two unmap sites. Doing it inside
dev_vfio_release_device(), next to the close, would cover any other
caller.
Stephen Hemminger (3):
eal/linux: do not warn when freeing interrupt source copy
bus/pci: reset VFIO device FD after release
eal/linux: close alarm timerfd on cleanup
drivers/bus/pci/linux/pci_vfio.c | 3 +++
lib/eal/linux/eal_alarm.c | 1 +
lib/eal/linux/eal_interrupts.c | 18 +++++++++++++++---
3 files changed, 19 insertions(+), 3 deletions(-)
--
2.51.0
Stephen Hemminger (3):
eal/linux: do not warn when freeing interrupt source copy
bus/pci: reset VFIO device FD after release
eal/linux: close alarm timerfd on cleanup
drivers/bus/pci/linux/pci_vfio.c | 3 +++
lib/eal/linux/eal_alarm.c | 1 +
lib/eal/linux/eal_interrupts.c | 18 +++++++++++++++---
3 files changed, 19 insertions(+), 3 deletions(-)
--
2.53.0
next reply other threads:[~2026-10-17 20:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-17 20:35 Stephen Hemminger [this message]
2026-10-17 20:35 ` [RFC 1/3] eal/linux: do not warn when freeing interrupt source copy Stephen Hemminger
2026-10-17 20:35 ` [RFC 2/3] bus/pci: reset VFIO device FD after release Stephen Hemminger
2026-10-17 20:35 ` [RFC 3/3] eal/linux: close alarm timerfd on cleanup Stephen Hemminger
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=20261017203621.3136254-1-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
/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