On Mon, Nov 14, 2016 at 02:44:29PM -0800, Andrew Morton wrote: > On Mon, 14 Nov 2016 15:07:33 +0800 Huang Shijie wrote: > I'm not really seeing a description of the actual bug. I don't know > what counter.sh is, there is no copy of counter.sh included in the > changelogs and there is no description of the kernel error which > counter.sh demonstrates. > > So can you pleaser send to me a copy of counter.sh as well as a > suitable description of the kernel error which counter.sh triggers? > Sorry. The counter.sh is just a wrapper for counter.c. I append them in the attachment, you can also find them in: https://github.com/libhugetlbfs/libhugetlbfs/blob/master/tests/counters.c https://github.com/libhugetlbfs/libhugetlbfs/blob/master/tests/counters.sh The description: The "counter.sh" test case will fail when we test the ARM64 32M gigantic page. The error shows below: ---------------------------------------------------------- ........................................... LD_PRELOAD=libhugetlbfs.so shmoverride_unlinked (32M: 64): PASS LD_PRELOAD=libhugetlbfs.so HUGETLB_SHM=yes shmoverride_unlinked (32M: 64): PASS quota.sh (32M: 64): PASS counters.sh (32M: 64): FAIL mmap failed: Invalid argument ********** TEST SUMMARY * 32M * 32-bit 64-bit * Total testcases: 0 87 * Skipped: 0 0 * PASS: 0 86 * FAIL: 0 1 * Killed by signal: 0 0 * Bad configuration: 0 0 * Expected FAIL: 0 0 * Unexpected PASS: 0 0 * Strange test result: 0 0 ********** ---------------------------------------------------------- The failure is caused by: 1) kernel fails to allocate a gigantic page for the surplus case. And the gather_surplus_pages() will return NULL in the end. 2) The condition checks for some functions are wrong: return_unused_surplus_pages() nr_overcommit_hugepages_store() hugetlb_overcommit_handler() Thanks Huang Shijie