mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-12 05:22:33 +00:00
dm: fix wrong hugetlb_lv_max
The logic to get hugetlb_lv_max is wrong. Correct it. Tracked-On: #4937 Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
This commit is contained in:
parent
e66de66697
commit
dc7d99c05a
@ -653,16 +653,13 @@ bool init_hugetlb(void)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (level = HUGETLB_LV1; level < HUGETLB_LV_MAX; level++) {
|
for (level = HUGETLB_LV1; level < HUGETLB_LV_MAX; level++)
|
||||||
if (mount_hugetlbfs(level) < 0) {
|
if (mount_hugetlbfs(level) < 0)
|
||||||
level--;
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (level < HUGETLB_LV1) /* mount fail for level 1 */
|
if (level == HUGETLB_LV1) /* mount fail for level 1 */
|
||||||
return false;
|
return false;
|
||||||
else if (level == HUGETLB_LV1) /* mount fail for level 2 */
|
else if (level == HUGETLB_LV2) /* mount fail for level 2 */
|
||||||
pr_warn("WARNING: only level 1 hugetlb supported");
|
pr_warn("WARNING: only level 1 hugetlb supported");
|
||||||
|
|
||||||
lock_fd = open(ACRN_HUGETLB_LOCK_FILE, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
|
lock_fd = open(ACRN_HUGETLB_LOCK_FILE, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
|
||||||
|
Loading…
Reference in New Issue
Block a user