I am wondering if there’s a support for CONFIG_HUGETLBFS and CONFIG_HUGETLB_PAGE? If I turn these options on, I get below error:
#error ARM Coherent DMA allocator does not (yet) support huge TLB
I see below code in kernel-4.9/arch/arm64/mm/dma-mapping.c:
#ifdef CONFIG_HUGETLB_PAGE
#error ARM Coherent DMA allocator does not (yet) support huge TLB
#endif
I wouldn’t want to just comment out this check as I am unsure of its effects overall on the system. But the reason I was thinking of turning on CONFIG_HUGETLBFS option was because now AGX Xavier has a 16GB of RAM which can be used for this.
I see that the files is L4T kernel is different than 4.9.108 kernel.org tree. In kernel.org tree there’s no code to error out if CONFIG_HUGETLB_PAGE is set. And that’s why I thought this could be NVIDIA tegra SOC specific.
It’s likely Tegra specific, perhaps because of the memory coherency requirements between the GPU and the four CPU clusters and other bus masters require additional work they haven’t managed to do yet.
Maybe they will fix it at some point, and maybe not. It very likely won’t work if you just remove the error. It also doesn’t work if you use plain 4.9 kernel, as it doesn’t have NVIDIA diffs for the Tegra specifics.
I’d love to hear more details from an NVIDIA person.
Right, hence I am hoping someone from NVIDIA responds on this thread.
Turning this option on is not a necessity but I wanted to see what happens since we have some unit tests to test some performance parameters with this on.
I can’t open the page on the link provided in the comment. But AFAIK, arm64 does support HUGETLBFS. I also see that CONFIG_SYS_SUPPORTS_HUGETLBFS is set to “=y”.
As I mentioned in my post, the error is occurring due to the pre-processor check that arch/arm64/mm/dma-mapping.c has. This check is not present in vanilla 4.9 kernel, that’s the reason I am wondering if this tegra specific check.
Removing the pre-processor check would work in kernel-4.9.
Recently I was able to check HUGETLBFS feature with removing this check and enabling HUGETLBFS config.
I am able to observe the changes in Hugepage statistics i.e. HugePages_Total, HugePages_Free, HugePages_Rsvd are getting right values updated based on accesses and usages from the hugepage pool.