From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id C75BD1B6F6 for ; Wed, 31 Jan 2018 00:54:20 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 70BF621040; Tue, 30 Jan 2018 18:54:20 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 30 Jan 2018 18:54:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=iwboQmILlovW1fhuVHCrGIMkgT BtNb1XOUTivE4QbHk=; b=mwQRAdSllzU4evF7HThMqwRo1+80MkXwtKWQedAuLZ JQdlY/jQ3BO65Y6nj2sYtItxkKADojR0imHImyC6srgpSm0TKZ/vgyOOchtZVgw8 lJVDs6OIi4n2FgYXk3rCxr1uTALXAMG3YPaZlHwVrZ9ur2OhiRyPxunC2WvCyjNO w= 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-sender:x-me-sender:x-sasl-enc; s=fm1; bh=iwboQm ILlovW1fhuVHCrGIMkgTBtNb1XOUTivE4QbHk=; b=NBuZlcjcFQSzcN1MrT8X+o IJztJedfKz0l3GZlGYOlybAWYQyhsEH4f4SLLi4oF2zR44GHdpEu9kny9v1FWUlR 5lVLXqFKl+lrqps7513AoQR1K/ZQBUbSkUidJyjx6MowzLaUGIFnKT5OzT69SfgR g+Ls3E0iep/HWzvgBsuUncZX6S7Zmt0p87ioIR6btB4NPw4sTPKsQs+2QkoVrgol xDVvARLfLUz6EfQmxt2gsifijkW2XOXe2oUWqaO/qScbN7zK66TUPP8n+kmnbZpM rXt4RO8i77E9UB6583JFJMXhDNbU6eOYEDOra4Rdp1m7aupptOB5xxmbwQvH99NQ == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 183CD24800; Tue, 30 Jan 2018 18:54:20 -0500 (EST) From: Thomas Monjalon To: Harry van Haaren Cc: dev@dpdk.org, pbhagavatula@caviumnetworks.com Date: Wed, 31 Jan 2018 00:53:32 +0100 Message-ID: <3782343.bUdYi8yfN7@xps> In-Reply-To: <1517336769-18052-1-git-send-email-harry.van.haaren@intel.com> References: <1517336497-17943-1-git-send-email-harry.van.haaren@intel.com> <1517336769-18052-1-git-send-email-harry.van.haaren@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2] test: fix debug autotest with eal cleanup addition 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: , X-List-Received-Date: Tue, 30 Jan 2018 23:54:21 -0000 30/01/2018 19:26, Harry van Haaren: > Before this patch, the debug_autotest would call fork(), > call rte_panic() or rte_exit() in the child process, and > examine the return code to verify that rte_panic() and > rte_exit() were correctly reporting failures. > > With the inclusion of the rte_eal_cleanup() patch, rte_exit() > was modified to cleanly tear-down EAL allocations. Currently > only one library (service cores) is allocated by EAL at startup > and should be cleaned up. This library has a check on a normal > (non-hugepage) variable to protect against double cleanup. The > service cores finalize() function itself frees back hugepage mem. > > Given the fork() approach from the unit test, and the fact that > the double-free check is on an ordinary variable, causes multiple > child processed (fork()-ed from the unit-test runner) to attempt > to free the huge-page memory multiple times. The variable to > protect against double-cleanup was not effective, as the fork() > would restore it to show initialized in the next child. > > The solution is to call rte_service_finalize() *before* calling > fork(), which results in the service cores double-cleanup variable > to be zero before the fork(), and hence the child processes never > free the hugepage service-cores memory (correct behavior, as the > unit-test suite is still running, and owns the hugepages). > > Fixes: aec9c13c5257 ("eal: add function to release internal resources") > > Reported-by: Pavan Nikhilesh > Signed-off-by: Harry van Haaren Applied, thanks