[dpdk-dev] [PATCH] mem: close rtemap files

Stephen Hemminger stephen at networkplumber.org
Mon Oct 19 18:23:11 CEST 2020


On Mon, 19 Oct 2020 08:42:35 -0700
Stephen Hemminger <stephen at networkplumber.org> wrote:

> The memory subsystem is leaving open a file descriptor for each
> rtemap file. This can lead to hundreds of extra open file descriptors
> which has negative side effects. For example, the application may go
> over its maximum file descriptor limit, or the application may be using
> limited API's like select that only allow 1024 file descriptors.
> 
> The EAL memory subsystem does not need to hold the file open.
> Probably the original intention was to keep the file locked, but that is
> not necessary. The Linux kernel keeps a reference count on the file,
> and the mmap counts is a reference and therefore maintains the file
> as locked.
> 
> The fix is one line just close the file after it is setup.
> 
> Fixes: 582bed1e1d1d ("mem: support mapping hugepages at runtime")
> Cc: anatoly.burakov at intel.com
> Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>

This is fixes the open files, but has issues on shutdown.
Will send new version later.


More information about the dev mailing list