From patchwork Fri Sep 21 11:56:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wodkowski, PawelX" X-Patchwork-Id: 45063 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1E6261041; Fri, 21 Sep 2018 10:16:11 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id C202AF04 for ; Fri, 21 Sep 2018 10:16:09 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Sep 2018 01:16:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,284,1534834800"; d="scan'208";a="265490016" Received: from kraken.imu.intel.com (HELO Sent) ([10.217.246.153]) by fmsmga006.fm.intel.com with SMTP; 21 Sep 2018 01:12:19 -0700 Received: by Sent (sSMTP sendmail emulation); Fri, 21 Sep 2018 13:56:39 +0200 From: Pawel Wodkowski To: dev@dpdk.org Cc: Pawel Wodkowski Date: Fri, 21 Sep 2018 13:56:38 +0200 Message-Id: <1537530998-109749-1-git-send-email-pawelx.wodkowski@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] eal: fix '--huge-unlink' option 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" The final_va field is set during remap_segment() but this information is not propagated to temporal copy of huge page memory configuration so the unlink_hugepage_files() function wrongly assume that there is nothing to unlink. Fix this issue by checking orig_va instead of final_va. Fixes: 66cc45e293ed ("mem: replace memseg with memseg lists") To: Anatoly Burakov Signed-off-by: Pawel Wodkowski Acked-by: Anatoly Burakov --- lib/librte_eal/linuxapp/eal/eal_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c index e3ac2481572d..b4a2b2b9e405 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memory.c +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c @@ -585,7 +585,7 @@ unlink_hugepage_files(struct hugepage_file *hugepg_tbl, for (page = 0; page < nrpages; page++) { struct hugepage_file *hp = &hugepg_tbl[page]; - if (hp->final_va != NULL && unlink(hp->filepath)) { + if (hp->orig_va != NULL && unlink(hp->filepath)) { RTE_LOG(WARNING, EAL, "%s(): Removing %s failed: %s\n", __func__, hp->filepath, strerror(errno)); }