From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id C8C57A0487
	for <public@inbox.dpdk.org>; Sat,  6 Jul 2019 00:06:33 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 3D9F21BE1D;
	Sat,  6 Jul 2019 00:06:32 +0200 (CEST)
Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com
 [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 580BB1BE1B
 for <dev@dpdk.org>; Sat,  6 Jul 2019 00:06:31 +0200 (CEST)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailout.nyi.internal (Postfix) with ESMTP id D199D213CA;
 Fri,  5 Jul 2019 18:06:27 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute1.internal (MEProxy); Fri, 05 Jul 2019 18:06:27 -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=YMC2uS8xMupqhKkffJljjpgnNERJgCisaBIfGx/di3c=; b=NGvSrOqi3yfc
 /yb4zbR9sRqab3tw9kkIZ/vppiKnbBAojL4Okl2S7DU0sGEwE8SKFWP5Ig7C/Oop
 pbTHSwZuNgkraxViwxqo0OnnR6hApRWvD3rxFQ8Pn/tWRmL1GDWCKmJc2cs/FtbM
 oUolI+8yzf5KFpaujTFq1ae2NmJy3lM=
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=fm3; bh=YMC2uS8xMupqhKkffJljjpgnNERJgCisaBIfGx/di
 3c=; b=Lz/zFF2cQ1aBe/wQAnTcUKqmJmuxkhXhr/utAK/hfdClHWYQ1RJwPEzG0
 Pgk1r9sQJZ0wUCvfEb1oeHbGQRb58Lnkv7QHU2xxI8EsM4IGhiPgyEuHmpsja/KD
 1Cm4m3iHqlY2eYoqSUCEeZlA82GY6rX6RxZdaXSgKt2keKCk2Tt+UsdLYeb314UZ
 rwAypgi8gMuW5LlDghWtsRfksYj1Y+Vrj81ZC0ez1quMkg/tg52lKycxn0v+ccu8
 QGj+MJ+nqjLYoRr329C7/q+6G9/gW/u6nzENVkBlRJsiOqN/1qNiUHS78gSgzB7T
 exBbSBK2X0T1AqVgNWuGUTdrt8aNw==
X-ME-Sender: <xms:48kfXSqn1VsUPwHnr5Da6BtkDWa29epU_eB2wS4iJamIYpltIR7--g>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrfeehgddtiecutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
 fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs
 ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucffoh
 hmrghinhepughpughkrdhorhhgnecukfhppeejjedrudefgedrvddtfedrudekgeenucfr
 rghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvthenuc
 evlhhushhtvghrufhiiigvpedt
X-ME-Proxy: <xmx:48kfXcgNAv3eUwQBFcMguPTsSOQMZz_iJ_K1jRjxblTtGZFXvvxS4Q>
 <xmx:48kfXX4LyIV55dOnMrGV9iyvQ3YvDTutJ9fbE59TqwfI2bPRtThgkA>
 <xmx:48kfXdFL0RDoi_X91FYIdjmkPXpZxTj1mEtW3XdrhsfxidoXtLuxEw>
 <xmx:48kfXUhbZ11KhwisJ3DZbQ0fP0ApYh5yIQ1LyHA6kxO7rpbdr-jCTA>
Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184])
 by mail.messagingengine.com (Postfix) with ESMTPA id 8AE83380076;
 Fri,  5 Jul 2019 18:06:26 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: Anatoly Burakov <anatoly.burakov@intel.com>
Cc: dev@dpdk.org, Robert Sanford <rsanford@akamai.com>,
 Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
Date: Sat, 06 Jul 2019 00:06:24 +0200
Message-ID: <3427711.pUUgotmRoR@xps>
In-Reply-To: <c4df88d88459bb157656e18f1bdf5549ce541527.1562347316.git.anatoly.burakov@intel.com>
References: <cover.1562347316.git.anatoly.burakov@intel.com>
 <c4df88d88459bb157656e18f1bdf5549ce541527.1562347316.git.anatoly.burakov@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Subject: Re: [dpdk-dev] [PATCH v3 1/1] 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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

05/07/2019 19:22, Anatoly Burakov:
> Currently, whenever timer library is initialized, the memory
> is leaked because there is no telling when primary or secondary
> processes get to use the state, and there is no way to
> initialize/deinitialize timer library state without race
> conditions [1] because the data itself must live in shared memory.
> 
> Add a spinlock to the shared mem config to have a way to
> exclusively initialize/deinitialize the timer library without
> any races, and implement the synchronization mechanism based
> on this lock in the timer library.
> 
> Also, update the API doc. Note that the behavior of the API
> itself did not change - the requirement to call init in every
> process was simply not documented explicitly.
> 
> Fixes: c0749f7096c7 ("timer: allow management in shared memory")
> 
> [1] See the following email thread:
> https://mails.dpdk.org/archives/dev/2019-May/131498.html
> 
> Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> Acked-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
> Reviewed-by: David Marchand <david.marchand@redhat.com>

Applied, thanks