From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.mhcomputing.net (master.mhcomputing.net [74.208.46.186]) by dpdk.org (Postfix) with ESMTP id 6E873683B for ; Thu, 30 Oct 2014 04:09:48 +0100 (CET) Received: by mail.mhcomputing.net (Postfix, from userid 1000) id 9D89080C50B; Wed, 29 Oct 2014 20:17:37 -0700 (PDT) Date: Wed, 29 Oct 2014 20:17:37 -0700 From: Matthew Hall To: linhaifeng Message-ID: <20141030031737.GB3286@mhcomputing.net> References: <1414561659-7408-1-git-send-email-haifeng.lin@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1414561659-7408-1-git-send-email-haifeng.lin@huawei.com> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2] support free hugepages X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 03:09:48 -0000 On Wed, Oct 29, 2014 at 01:47:39PM +0800, linhaifeng wrote: > +int > +rte_eal_hugepage_free(void) > +{ > + struct hugepage_file *hugepg_tbl = g_hugepage_table.hugepg_tbl; > + unsigned i; > + unsigned nr_hugefiles = g_hugepage_table.nr_hugefiles; > + int ret = 0; > + > + for (i = 0; i < nr_hugefiles; i++) { > + ret = unlink(hugepg_tbl[i].filepath); > + if (ret != 0) { > + RTE_LOG(ERR, EAL, "Failed to unlink %s", hugepg_tbl[i].filepath); > + return ret; I would say, don't exit just because one couldn't be freed. Free everything you can but exit with an error so people can know what happened. Thanks for the patch, good idea! Matthew.