On 2/21/24 16:37, Daniel Wagner wrote: > On Wed, Feb 21, 2024 at 06:22:29AM +0000, Shinichiro Kawasaki wrote: >> I found this changes makes the test case fail when the kernel does not have >> CONFIG_HUGETLBFS. Without the config, /proc/sys/vm/nr_hugepages does not >> exist. >> >> When CONFIG_HUGETLBFS is not defined, should we skip this test case? > > Obviously, we should aim for really solid test cases. Though it is not > guaranteed that the test will pass even with CONFIG_HUGETLBS enabled. I > suspect we would need to make some more preparation steps that the > allocation has a high change to pass. Though I haven't really looked > into what the necessary steps would be. The sysfs exposes a few more > knobs to play with. "echo 3 > /proc/sys/vm/drop_caches" before mounting hugetlbfs should allow for the big pages to fit... Still no guarantees but likely that will lower setup failure frequency. > >> If this is >> the case, we can add "_have_kernel_option HUGETLBFS" in requires(). If not, we >> should check existence of /proc/sys/vm/nr_hugepages before touching it, like: >> >> if [[ -r /proc/sys/vm/nr_hugepages && >> "$(cat /proc/sys/vm/nr_hugepages)" -eq 0 ]]; then > > Sure, I'll add this and also fix the typos in the commit message. > >> >> Also I suggest to add in-line comment to help understanding why nr_hugepages >> sysfs needs change. Something like, >> >> # nvme-cli may fail to allocate linear memory for rather large IO buffers. >> # Increase nr_hugepages to allow nvme-cli to try the linear memory allocation >> # from HugeTLB pool. > > Ok. > -- Damien Le Moal Western Digital Research