From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Hall Subject: Re: [PATCH v2] support free hugepages Date: Wed, 29 Oct 2014 20:17:37 -0700 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 Cc: dev-VfR2kkLFssw@public.gmane.org To: linhaifeng Return-path: Content-Disposition: inline In-Reply-To: <1414561659-7408-1-git-send-email-haifeng.lin-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 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.