A couple of us started looking at adding fallocate() preallocation and punch hole support to hugetlbfs. The offset and length arguments to fallocate are in bytes, and the man page is pretty explicit about what is expected if ranges do not start or end on page boundaries. Looking at fallocate led me to take a closer look at ftruncate for hugetlbfs as ideally we would reuse some of that code. I noticed that ftruncate requires the length parameter to be huge page aligned. I am pretty sure this was done because hugetlbfs only deals in increments of huge pages. inode size appears to never be set to anything that is not a multiple of huge page size. However, the ftruncate man page does not place too many restrictions on the value of length. And AFICT, there is no documentation about ftruncate returning EINVAL if length is not a multiple of huge page size. So my question is, do we try to support hugetlbfs files that are not a multiple of huge page size in length? Or, document that hugetlbfs is 'special' when it comes to truncate? This same question applies to fallocate as the man page also says that it is possible to set file size to an arbitrary (non huge page size aligned value). cc'ing some people from the recent hugetlb munmap alignment thread as I'm sure they will have an opinion here. -- Mike Kravetz -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>