mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-14 03:54:18 +00:00
check if there are enough free huge pages(1GB & 2MB now) for UOS, if no, it will try to reserve more pages for UOS. here are two examples 1. if system has free huge pages: 1 page of 1GB size, 0 page of 2MB. one UOS need 2GB + 500MB memory, it will try to reserve one more 1GB page and 250 2MB pages from system. If enough free system memory, it can succeed. 2. if system has free huge pages: 4 pages of 1GB size, 0 page of 2MB. one UOS need 2GB + 500MB, 1GB huge pages 4 > 2, it's enough, and 2 pages left. It will try to reserve 250 2MB pages from system free memory, if failed, it will try to release 1 of the 2 left 1GB pages. And then try to reserve 250 2MB pages. Signed-off-by: Minggui Cao <minggui.cao@intel.com> Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>