From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH] mem: fix how to calculate space left in a hugetlbfs Date: Thu, 12 Nov 2015 09:38:26 -0800 Message-ID: <20151112093826.5f287608@xeon-e3> References: <1447287477-49292-1-git-send-email-jianfeng.tan@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Jianfeng Tan Return-path: Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by dpdk.org (Postfix) with ESMTP id 3212D91D6 for ; Thu, 12 Nov 2015 18:38:16 +0100 (CET) Received: by pabfh17 with SMTP id fh17so71132788pab.0 for ; Thu, 12 Nov 2015 09:38:15 -0800 (PST) In-Reply-To: <1447287477-49292-1-git-send-email-jianfeng.tan@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, 12 Nov 2015 08:17:57 +0800 Jianfeng Tan wrote: > This patch enables calculating space left in a hugetlbfs. > There are three sources to get the information: 1. from > sysfs; 2. from option size specified when mount; 3. use > statfs. We should use the minimum one of these three sizes. > > Signed-off-by: Jianfeng Tan Thanks, the hugetlbfs usage up until now has been rather brute force. I wonder if long term it might be better to defer all this stuff to another library like libhugetlbfs. https://github.com/libhugetlbfs/libhugetlbfs Especially wen dealing with other architectures it might provide some nice abstraction.