From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 3175AA0096 for ; Wed, 5 Jun 2019 11:34:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 276A41B9BD; Wed, 5 Jun 2019 11:34:04 +0200 (CEST) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by dpdk.org (Postfix) with ESMTP id B62FB1B9B8 for ; Wed, 5 Jun 2019 11:34:02 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 4E9D65B8; Wed, 5 Jun 2019 05:34:01 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 05 Jun 2019 05:34:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=Qt493ansPZ1+otP35ldczkpgSLF5++GbIPw2Vz/OOK4=; b=oKfFC0qvOYZl 30SNVRMwB8XN6g/bkhCuO+kLKzO08POMIdEtz0B+1kxEdoV14L6qgNbcMZq6/WEO mvgDk93vnQTONNUO8Gh+eKhGyda28zP2Bz9oc0IbV1i9kM8aFgeh7hVE9d+gOG3G rTUKU9MsyU0Mb7iiPE9nQE1y2eq4NuM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=Qt493ansPZ1+otP35ldczkpgSLF5++GbIPw2Vz/OO K4=; b=f/pPUa5CqNiM8gPVwoxiiGaCZ4tDfJs6kAz2RJMNVfEOOv6ns05ZjkqRG nGtVaH7qCu1otwqlo0LVK3VGgM4NDmTn1a3Ywk8rSmgiwDXLRMPQl7QxkpYRJ7AO ijVAOGY332EPfB7AV7Pm1BXCpUFpil1s0vzi6+ISKL9SsFQ+st1eI+zVLLMEQRjM 21O3rjaLRnaEWmprhutrZuC5NjFzM/toEymrot19li4sZy0x8p2ZvOE5PePr+klz fAfbdqF1HauZrG78V+TEWBZtimp3gLLjYMHbPen1577+WYaJGDFqVaFkloqn1mkt HKm+9beBX8zFH9pIMHQhm8TsxXD4g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrudegvddgudejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecuff homhgrihhnpeguphgukhdrohhrghenucfkphepjeejrddufeegrddvtdefrddukeegnecu rfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtne cuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 5CF0A80063; Wed, 5 Jun 2019 05:33:59 -0400 (EDT) From: Thomas Monjalon To: Erik Gabriel Carrillo Cc: dev@dpdk.org, "Burakov, Anatoly" , rsanford@akamai.com, david.marchand@redhat.com Date: Wed, 05 Jun 2019 11:33:58 +0200 Message-ID: <4234840.t272voWUu0@xps> In-Reply-To: <3809be84-8fa7-b91d-d781-f62e0506f293@intel.com> References: <1556924082-22535-1-git-send-email-erik.g.carrillo@intel.com> <1557354906-2500-1-git-send-email-erik.g.carrillo@intel.com> <3809be84-8fa7-b91d-d781-f62e0506f293@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v3] timer: fix resource leak in finalize 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" 09/05/2019 10:29, Burakov, Anatoly: > On 08-May-19 11:35 PM, Erik Gabriel Carrillo wrote: > > By using a lock added to the rte_mem_config (which lives in shared > > memory), we can synchronize multiple processes in init/finalize and > > safely free allocations made during init. > > > > Signed-off-by: Erik Gabriel Carrillo > > --- > > changes in v3: > > - The previous version had race condition. This version fixes the race > > by adding a lock in shared memory outside of the DPDK heap area > > that can be used to safely free the memzone reserved in the subsystem > > init call. (Anatoly) > > > > This patch depends on http://patches.dpdk.org/patch/53333/. > > > > changes in v2: > > - Handle scenario where primary process exits before secondaries such > > that memzone is not freed early (Anatoly) > > > > lib/librte_eal/common/include/rte_eal_memconfig.h | 3 +++ > > lib/librte_timer/rte_timer.c | 23 ++++++++++++++++++++++- > > 2 files changed, 25 insertions(+), 1 deletion(-) > > > > diff --git a/lib/librte_eal/common/include/rte_eal_memconfig.h b/lib/librte_eal/common/include/rte_eal_memconfig.h > > index 84aabe3..8cbc09c 100644 > > --- a/lib/librte_eal/common/include/rte_eal_memconfig.h > > +++ b/lib/librte_eal/common/include/rte_eal_memconfig.h > > @@ -64,6 +64,9 @@ struct rte_mem_config { > > rte_rwlock_t memory_hotplug_lock; > > /**< indicates whether memory hotplug request is in progress. */ > > > > + rte_spinlock_t timer_subsystem_lock; > > + /**< indicates whether timer subsystem init/finalize is in progress. */ > > + > > I believe there's an initialize function somewhere which will initialize > all of these locks. This lock should be in there as well. > > Other than that, i'm OK with this change, however i feel like /just/ > adding this would be a missed opportunity, because next time we want to > add something here it will be an ABI break again. > > We could perhaps use this opportunity to leave some padding for future > data. I'm not sure how would that look like, just an idea floating in my > head :) Any update or other opinion?