From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1F639A0597; Thu, 9 Apr 2020 14:06:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 09B491C23F; Thu, 9 Apr 2020 14:06:30 +0200 (CEST) Received: from smtprelay04.ispgateway.de (smtprelay04.ispgateway.de [80.67.31.32]) by dpdk.org (Postfix) with ESMTP id DD1121C23E for ; Thu, 9 Apr 2020 14:06:28 +0200 (CEST) Received: from [95.90.46.11] (helo=nb-mweiser.local) by smtprelay04.ispgateway.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.3) (envelope-from ) id 1jMVww-0004wR-2b; Thu, 09 Apr 2020 14:06:26 +0200 From: Martin Weiser To: "Lu, Wenzhuo" , konstantin.ananyev@intel.com, xiaolong.ye@intel.com, taox.zhu@intel.com, Ferruh Yigit References: <35d734a2-34c4-3cc8-6e3e-58a17a7bb9da@allegro-packets.com> Cc: "dev@dpdk.org" Autocrypt: addr=martin.weiser@allegro-packets.com; prefer-encrypt=mutual; keydata= mQINBFQEOvgBEADV9gmB6O20GO+WviGWqcfR5GofDWazzHVQSxbwJGO2ECNDgzh7JHNyc7bl r6er7asKUfrm9yr3l+C1AtChxxYjOldRW+T/UFlJ+qU8yu1EnNJPZYNcUCE1yZtxQtP5FRax Y1KCshurdsbbRzb4rwWLsoP27snqbJnxKuxRUBe5OUImaKxKmJFWV6n3oJ15KwTEObolDEh0 siWtWXWnfGWMY0xUBqPxIxqWLNH39LBiuq1EQMtX//rpKKTg5LWZVFZEpyZKNptNKpVYl0vI jAozbkuml3JRVP6vzkNgdnfxLLdV1WHmLltkVW1IVLpFE1iy6OmY//IuY4Rnr36q2qGl5GTQ Zk72LV0We6O5fhB//AC0Dj8f/Y5XD0cVi37W5t3k9V43Spx7e17HGytiKWo8KaWSXBb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FB0pGl9hODYLNcNzqqeCEo5x MqUar0RmCfUC3FgxhANQvHERMfqSZTm7Hg2s/xN8NAbJpWRPFmPOpTn7xCgDu0AJc3ZMQ3Iy pAvVozZ4xa8nyzBDALovXXxkumwl8MsU4UqP9TWaV601uWhEa0/ZF5R9hI7IPy/GKZOUTnCy /xB1zLmxNx3Z88J8botI/5j4T9yl0OpzT6+zfQmpj+1eHE/OitFPNG/9vHVW/xRwlxgzDlRh tYJbkQRWU1aIZwNfkaWq4TIEtpcqeziiPApQFe38kZZXfcJl0X3hwKGJ/AHF1XuoPKLfLhwp 9dmxmt3FycRWGCAXj+hfbvhNkC0O5Lwy9xdx6pp7TYvXn+ekOQjeOFK27Im6OuQsUozzKLno GgYyzU4GQQxtGmh3FJpyWMzxuWBw4e3D8bV9HzgsoXUdfN1gQSoiY9o/I2EIyyFJCoM1lK7k MXWMClgW8ybd/hammQ== Message-ID: <25ebe98d-071e-a80a-fa87-42385f4cd72b@allegro-packets.com> Date: Thu, 9 Apr 2020 14:06:25 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <35d734a2-34c4-3cc8-6e3e-58a17a7bb9da@allegro-packets.com> Content-Language: en-US X-Df-Sender: bWFydGluLndlaXNlckBhbGxlZ3JvLXBhY2tldHMuY29t Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] net/ixgbe: ixgbe_dev_link_update_share() leaks memory and memory mappings due to not cleaning up pthreads X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, I should have mentioned that our findings apply to DPDK 20.02. I can see in master that this since has been reworked to use rte_eal_alarm_set() instead of using a thread. But maybe this should be addressed in stable? Best regards, Martin Weiser Am 09.04.20 um 12:30 schrieb Martin Weiser: > 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 >