First time in linux kernel here.
Anyways, my question is, if you're here:
You have access to these two structs inside the
struct file *file, struct vm_area_struct *vma
// vm_area_struct defined in /include/linux/mm_types.h : 284
// file defined in /include/linux/fs.h : 848
loff_t file_size = file_inode(file)->i_size;
unsigned long start_va = vma->vm_start;
First of all mmap support MAP_POPULATE flag specifically to avoid page faults. In principle it may be it does not work with dax, but that's unlikely.
Second of all it seems you don't have any measurements of the current state of affairs. Just "changing something and checking the difference" is a fundamentally wrong approach. In particular it may be the actual bottleneck will be removed as an unintended consequence of the change and the win will end up being misattributed. You can start by using 'perf' to get basic numbers and generating flamegraphs ( http://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html ). If you do a lot of i/o over a small range, page faults should have a negligible effect.