From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v5] eal: fix allocating all free hugepages Date: Thu, 30 Jun 2016 15:34:51 +0200 Message-ID: <7052044.2d0khXtSiK@xps13> References: <1453661393-85704-1-git-send-email-jianfeng.tan@intel.com> <1464665827-24965-1-git-send-email-jianfeng.tan@intel.com> <5e903b16-453e-100f-fea4-75229e33344f@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: Sergio Gonzalez Monroy , dev@dpdk.org, nhorman@tuxdriver.com, david.marchand@6wind.com To: Jianfeng Tan Return-path: Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by dpdk.org (Postfix) with ESMTP id 9F4A4DE0 for ; Thu, 30 Jun 2016 15:34:56 +0200 (CEST) Received: by mail-wm0-f44.google.com with SMTP id a66so119028463wme.0 for ; Thu, 30 Jun 2016 06:34:56 -0700 (PDT) In-Reply-To: <5e903b16-453e-100f-fea4-75229e33344f@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" > > EAL memory init allocates all free hugepages of the whole system, > > which seen from sysfs, even when applications do not ask so many. > > When there is a limitation on how many hugepages an application can > > use (such as cgroup.hugetlb), or hugetlbfs is specified with an > > option of size (exceeding the quota of the fs), it just fails to > > start even there are enough hugepages allocated. > > > > To fix above issue, this patch: > > - Changes the logic to continue memory init to see if hugetlb > > requirement of application can be addressed by already allocated > > hugepages. > > - To make sure each hugepage is allocated successfully, we add a > > recover mechanism, which relies on a mem access to fault-in > > hugepages, and if it fails with SIGBUS, recover to previously > > saved stack environment with siglongjmp(). > > > > For the case of CONFIG_RTE_EAL_SINGLE_FILE_SEGMENTS (enabled by > > default when compiling IVSHMEM target), it's indispensable to > > mapp all free hugepages in the system. Under this case, it fails > > to start when allocating fails. [...] > > Signed-off-by: Jianfeng Tan > > Acked-by: Neil Horman > > Acked-by: Sergio Gonzalez Monroy Applied, thanks