From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755021AbbCFPKu (ORCPT ); Fri, 6 Mar 2015 10:10:50 -0500 Received: from cantor2.suse.de ([195.135.220.15]:39825 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754006AbbCFPKt (ORCPT ); Fri, 6 Mar 2015 10:10:49 -0500 Date: Fri, 6 Mar 2015 16:10:45 +0100 From: Michal Hocko To: Mike Kravetz Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Nadia Yvette Chambers , Aneesh Kumar , Joonsoo Kim Subject: Re: [RFC 0/3] hugetlbfs: optionally reserve all fs pages at mount time Message-ID: <20150306151045.GA23443@dhcp22.suse.cz> References: <1425077893-18366-1-git-send-email-mike.kravetz@oracle.com> <20150302151009.2ae58f4430f9f34b81533821@linux-foundation.org> <54F50BD6.1030706@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54F50BD6.1030706@oracle.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 02-03-15 17:18:14, Mike Kravetz wrote: > On 03/02/2015 03:10 PM, Andrew Morton wrote: > >On Fri, 27 Feb 2015 14:58:08 -0800 Mike Kravetz wrote: > > > >>hugetlbfs allocates huge pages from the global pool as needed. Even if > >>the global pool contains a sufficient number pages for the filesystem > >>size at mount time, those global pages could be grabbed for some other > >>use. As a result, filesystem huge page allocations may fail due to lack > >>of pages. > > > >Well OK, but why is this a sufficiently serious problem to justify > >kernel changes? Please provide enough info for others to be able > >to understand the value of the change. > > > > Thanks for taking a look. > > Applications such as a database want to use huge pages for performance > reasons. hugetlbfs filesystem semantics with ownership and modes work > well to manage access to a pool of huge pages. However, the application > would like some reasonable assurance that allocations will not fail due > to a lack of huge pages. Before starting, the application will ensure > that enough huge pages exist on the system in the global pools. What > the application wants is exclusive use of a pool of huge pages. > > One could argue that this is a system administration issue. The global > huge page pools are only available to users with root privilege. > Therefore, exclusive use of a pool of huge pages can be obtained by > limiting access. However, many applications are installed to run with > elevated privilege to take advantage of resources like huge pages. It > is quite possible for one application to interfere another, especially > in the case of something like huge pages where the pool size is mostly > fixed. > > Suggestions for other ways to approach this situation are appreciated. > I saw the existing support for "reservations" within hugetlbfs and > thought of extending this to cover the size of the filesystem. Maybe I do not understand your usecase properly but wouldn't hugetlb cgroup (CONFIG_CGROUP_HUGETLB) help to guarantee the same? Just configure limits for different users/applications (inside different groups) so that they never overcommit the existing pool. Would that work for you? -- Michal Hocko SUSE Labs