Also, if the vm area is large, pages might be thrashing, requiring the kernel to do loads of work swapping things in and out and changing the pagetable struct.
Also, if the vm area is large, pages might be thrashing, requiring the kernel to do loads of work swapping things in and out and changing the pagetable struct.
I doubt that that's any different than allocating memory assuming your working set would be the same. Largely it should be unless the mmap design makes it easier to facilitate a random access pattern in your data structure that you would think twice about if you actually had to issue the reads yourself.
The bigger issue is that madvise & friends risk cross table shootdowns since Linux might not have relevant support for DONT_NEED other than unmapping (vs scheduling an unmapping to happen lazily). However, that isn't necessarily the case with Windows.
Linux just takes that as a hint to unmap immediately and this results in a cross tlb shoot down. Cross tlb shoot downs are crazy expensive. Windows might have better support for doing it lazily and not paying the cost.