From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9E82A45B34; Mon, 14 Oct 2024 08:51:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 667E540273; Mon, 14 Oct 2024 08:51:14 +0200 (CEST) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by mails.dpdk.org (Postfix) with ESMTP id D335740151 for ; Mon, 14 Oct 2024 08:51:12 +0200 (CEST) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 5A256E6B3 for ; Mon, 14 Oct 2024 08:51:12 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 4DFF3E5E8; Mon, 14 Oct 2024 08:51:12 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on hermod.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,AWL, T_SCC_BODY_TEXT_LINE autolearn=disabled version=4.0.0 X-Spam-Score: -1.2 Received: from [192.168.1.85] (h-62-63-215-114.A163.priv.bahnhof.se [62.63.215.114]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 0B069E6B2; Mon, 14 Oct 2024 08:51:09 +0200 (CEST) Message-ID: <99c08d4b-d8bc-48d2-92f2-1ce37e61eff6@lysator.liu.se> Date: Mon, 14 Oct 2024 08:51:09 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v9 1/7] eal: add static per-lcore memory allocation facility From: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= To: Thomas Monjalon , =?UTF-8?Q?Mattias_R=C3=B6nnblom?= Cc: dev@dpdk.org, =?UTF-8?Q?Morten_Br=C3=B8rup?= , Stephen Hemminger , Konstantin Ananyev , David Marchand , Jerin Jacob , Luka Jankovic , Konstantin Ananyev , Chengwen Feng References: <20241010141349.813088-2-mattias.ronnblom@ericsson.com> <20241010142205.813134-1-mattias.ronnblom@ericsson.com> <20241010142205.813134-2-mattias.ronnblom@ericsson.com> <1829355.yIU609i1g2@thomas> <5818e22a-1e22-4533-85b8-fb9d00c834da@lysator.liu.se> Content-Language: en-US In-Reply-To: <5818e22a-1e22-4533-85b8-fb9d00c834da@lysator.liu.se> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 2024-10-11 10:04, Mattias Rönnblom wrote: > On 2024-10-10 23:24, Thomas Monjalon wrote: >>> + * >>> + * An lcore variable is not tied to the owning thread's lifetime. It's >>> + * available for use by any thread immediately after having been >>> + * allocated, and continues to be available throughout the lifetime of >>> + * the EAL. >>> + * >>> + * Lcore variables cannot and need not be freed. >> >> I'm curious about that. >> If EAL is closed, and the application continues its life, >> then we want all this memory to be cleaned as well. >> Do you know rte_eal_cleanup()? > > I think the primary reason you would like to free the buffers is to > avoid false positives from tools like valgrind memcheck (if anyone > managed to get that working with DPDK). > > rte_eal_cleanup() freeing the buffers and resetting the offset would > make sense. That however would require the buffers to be tracked (e.g., > as a linked list). > I had a quick look at this. Cleaning up the lcore var buffers is very straightforward. One thing though: the rte_eal_cleanup() documentation says "After this call, no DPDK function calls may be made.". rte_eal_init() is a "DPDK function call". So DPDK/EAL can never be re-initialized, correct? Cleaning up lcore var buffers would further cement this design, since there will be no way to re-initialize them other than changing the API. > From a footprint point of view, TLS allocations and static arrays also > aren't freed by rte_eal_cleanup(). >