From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752756AbbB1RZY (ORCPT ); Sat, 28 Feb 2015 12:25:24 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:35848 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752625AbbB1RZX (ORCPT ); Sat, 28 Feb 2015 12:25:23 -0500 Message-ID: <54F1F9F3.3060406@oracle.com> Date: Sat, 28 Feb 2015 09:25:07 -0800 From: Mike Kravetz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Hillf Danton CC: linux-kernel , linux-mm@kvack.org, Andrew Morton , davidlohr@hp.com, "'Aneesh Kumar'" , "'Joonsoo Kim'" Subject: Re: [RFC 2/3] hugetlbfs: coordinate global and subpool reserve accounting References: <013001d05306$31c8b250$955a16f0$@alibaba-inc.com> In-Reply-To: <013001d05306$31c8b250$955a16f0$@alibaba-inc.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: ucsinet21.oracle.com [156.151.31.93] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/27/2015 07:25 PM, Hillf Danton wrote: >> @@ -3444,10 +3445,14 @@ int hugetlb_reserve_pages(struct inode *inode, >> * Check enough hugepages are available for the reservation. >> * Hand the pages back to the subpool if there are not >> */ > > Better if comment is updated correspondingly. > Hillf Thanks Hillf. I'll also take a look at other comments in the area of 'accounting'. As I discovered, it is only a matter of adjusting the accounting to support reservation of pages for the entire filesystem. -- Mike Kravetz >> - ret = hugetlb_acct_memory(h, chg); >> - if (ret < 0) { >> - hugepage_subpool_put_pages(spool, chg); >> - goto out_err; >> + if (subpool_reserved(spool)) >> + ret = 0; >> + else { >> + ret = hugetlb_acct_memory(h, chg); >> + if (ret < 0) { >> + hugepage_subpool_put_pages(spool, chg); >> + goto out_err; >> + } >> } >>