Re: [RFC 1/3] hugetlbfs: add reserved mount fields to subpool structure

From: Mike Kravetz
Date: Mon Mar 02 2015 - 20:22:04 EST


On 03/02/2015 03:10 PM, Andrew Morton wrote:
On Fri, 27 Feb 2015 14:58:10 -0800 Mike Kravetz <mike.kravetz@xxxxxxxxxx> wrote:

Add a boolean to the subpool structure to indicate that the pages for
subpool have been reserved. The hstate pointer in the subpool is
convienient to have when it comes time to unreserve the pages.
subool_reserved() is a handy way to check if reserved and take into
account a NULL subpool.

...

@@ -38,6 +40,10 @@ extern int hugetlb_max_hstate __read_mostly;
#define for_each_hstate(h) \
for ((h) = hstates; (h) < &hstates[hugetlb_max_hstate]; (h)++)

+static inline bool subpool_reserved(struct hugepage_subpool *spool)
+{
+ return spool && spool->reserved;
+}

"subpool_reserved" is not a good identifier.

struct hugepage_subpool *hugepage_new_subpool(long nr_blocks);
void hugepage_put_subpool(struct hugepage_subpool *spool);

See what they did?

Got it. Thanks. hugepage_subpool_reserved

--
Mike Kravetz
--
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/