|
@@ -144,7 +144,8 @@ static long hugepage_subpool_get_pages(struct hugepage_subpool *spool,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (spool->min_hpages != -1) { /* minimum size accounting */
|
|
|
+ /* minimum size accounting */
|
|
|
+ if (spool->min_hpages != -1 && spool->rsv_hpages) {
|
|
|
if (delta > spool->rsv_hpages) {
|
|
|
/*
|
|
|
* Asking for more reserves than those already taken on
|
|
@@ -182,7 +183,8 @@ static long hugepage_subpool_put_pages(struct hugepage_subpool *spool,
|
|
|
if (spool->max_hpages != -1) /* maximum size accounting */
|
|
|
spool->used_hpages -= delta;
|
|
|
|
|
|
- if (spool->min_hpages != -1) { /* minimum size accounting */
|
|
|
+ /* minimum size accounting */
|
|
|
+ if (spool->min_hpages != -1 && spool->used_hpages < spool->min_hpages) {
|
|
|
if (spool->rsv_hpages + delta <= spool->min_hpages)
|
|
|
ret = 0;
|
|
|
else
|