linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/3] hugetlbfs: optionally reserve all fs pages at mount time
@ 2015-02-27 22:58 Mike Kravetz
  2015-02-27 22:58 ` [RFC 1/3] hugetlbfs: add reserved mount fields to subpool structure Mike Kravetz
                   ` (5 more replies)
  0 siblings, 6 replies; 20+ messages in thread
From: Mike Kravetz @ 2015-02-27 22:58 UTC (permalink / raw)
  To: linux-mm, linux-kernel
  Cc: Nadia Yvette Chambers, Andrew Morton, Davidlohr Bueso,
	Aneesh Kumar, Joonsoo Kim, Mike Kravetz

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.

Add a new hugetlbfs mount option 'reserved' to specify that the number
of pages associated with the size of the filesystem will be reserved.  If
there are insufficient pages, the mount will fail.  The reservation is
maintained for the duration of the filesystem so that as pages are
allocated and free'ed a sufficient number of pages remains reserved.

Mike Kravetz (3):
  hugetlbfs: add reserved mount fields to subpool structure
  hugetlbfs: coordinate global and subpool reserve accounting
  hugetlbfs: accept subpool reserved option and setup accordingly

 fs/hugetlbfs/inode.c    | 15 +++++++++++++--
 include/linux/hugetlb.h |  7 +++++++
 mm/hugetlb.c            | 37 +++++++++++++++++++++++++++++--------
 3 files changed, 49 insertions(+), 10 deletions(-)

-- 
2.1.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: [RFC 2/3] hugetlbfs: coordinate global and subpool reserve accounting
@ 2015-02-28  3:25 Hillf Danton
  2015-02-28 17:25 ` Mike Kravetz
  0 siblings, 1 reply; 20+ messages in thread
From: Hillf Danton @ 2015-02-28  3:25 UTC (permalink / raw)
  To: 'Mike Kravetz'
  Cc: linux-kernel, linux-mm, Andrew Morton, davidlohr,
	'Aneesh Kumar', 'Joonsoo Kim'

> @@ -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
> -	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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2015-03-06 21:32 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-27 22:58 [RFC 0/3] hugetlbfs: optionally reserve all fs pages at mount time Mike Kravetz
2015-02-27 22:58 ` [RFC 1/3] hugetlbfs: add reserved mount fields to subpool structure Mike Kravetz
2015-02-27 22:58 ` Mike Kravetz
2015-03-02 23:10   ` Andrew Morton
2015-03-03  1:20     ` Mike Kravetz
2015-02-27 22:58 ` [RFC 2/3] hugetlbfs: coordinate global and subpool reserve accounting Mike Kravetz
2015-03-02 23:10   ` Andrew Morton
2015-03-03  1:30     ` Mike Kravetz
2015-02-27 22:58 ` Mike Kravetz
2015-02-27 22:58 ` [RFC 3/3] hugetlbfs: accept subpool reserved option and setup accordingly Mike Kravetz
2015-03-02 23:10   ` Andrew Morton
2015-03-03  1:36     ` Mike Kravetz
2015-03-02 23:10 ` [RFC 0/3] hugetlbfs: optionally reserve all fs pages at mount time Andrew Morton
2015-03-03  1:18   ` Mike Kravetz
2015-03-06 15:10     ` Michal Hocko
2015-03-06 18:58       ` Mike Kravetz
2015-03-06 21:14         ` David Rientjes
2015-03-06 21:32           ` Mike Kravetz
  -- strict thread matches above, loose matches on Subject: below --
2015-02-28  3:25 [RFC 2/3] hugetlbfs: coordinate global and subpool reserve accounting Hillf Danton
2015-02-28 17:25 ` Mike Kravetz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).