[dpdk-dev] [PATCH v2] support free hugepages

Matthew Hall mhall at mhcomputing.net
Thu Oct 30 04:17:37 CET 2014


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.


More information about the dev mailing list