[dpdk-dev] net/ixgbe: ixgbe_dev_link_update_share() leaks memory and memory mappings due to not cleaning up pthreads

Martin Weiser martin.weiser at allegro-packets.com
Thu Apr 9 12:31:51 CEST 2020


Hi,

we recently discovered that our application was not able to create new
threads or perform mmaps after some time.
With some digging we identified the function
ixgbe_dev_link_update_share() to be the reason for this behavior.

In the patch "net/ixgbe: fix blocking system events"
(819d0d1d57f17aa40321648e99a50b49adc7bdf6) a thread is introduced to run
ixgbe_dev_setup_link_thread_handler().
Unfortunately this thread is not detached and just joined (the very last
one spawned that is) through ixgbe_dev_cancel_link_thread() upon
interface start/stop.

When an application repeatedly calls e.g. rte_eth_link_get_nowait() on
an ixgbe interface with no link this causes a lot of pthreads never to
be cleaned up.
Since each thread holds a mmap to the stack this can quite quickly
exhaust the allowed number of memory mappings for the process.

Best regards,
Martin Weiser



More information about the dev mailing list