在 2025/2/27 14:19, Oscar Salvador 写道:
On Thu, Feb 27, 2025 at 11:11:25AM +0800, Jinjiang Tu wrote:
The result with this patch:
Node 0 Node 1
Total 5 0
Free 0 0
Surp 5 0
Why would node0 have any surplus pages?
Also, this does not reproduce in my machine.
Are you overcommitting? Are you using the hvo optimization?
If so, it might be that we cannot allocate vmemmap pages and those
hugetlb pages stay in a surplus state?
>From bulk_vmemmap_restore_error():
* If unable to restore a hugetlb page, the hugetlb
* page is made a surplus page and removed from the list.
So surplus pages may be free pages and not reserved. In this patch, we
shouldn't subtract surplus_huge_pages from min_mount, otherwise these free
pages will be subtracted twice.