From: Caspar Z. <ca...@ca...> - 2011-12-28 07:13:40
|
On 12/28/2011 02:23 PM, Wanlong Gao wrote: >>> >> + tst_tmpdir(); >>> >> + mount_point = get_tst_tmpdir(); >>> >> + mount_hugetlbfs(mount_point); >>> >> + hugepage_alloc(1024); > > sure, will change to a macro. I don't think a macro can improve much. You patch reduces the testcase scalability. A better way is passing hugepage size you want to set via option: ./hugemmap01 -s 1024 The default value 1024 is not good enough, for x86 systems, it will require at least 2GB free memory, for other systems, like powerpc, it will require 16GB free memory. It would be better if you calculate how much memory the system can be used for hugepages. One more thing (on libmnt.c side), is there any action if hugepage_alloc set 0, and is there any action if you want to set 1024 hpages, but only allocated less amount than that? Thanks, Caspar |