Re: [RFC 2/3] hugetlbfs: coordinate global and subpool reserve accounting

From: Mike Kravetz
Date: Sat Feb 28 2015 - 12:25:27 EST


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;
+ }
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/