3 ms·
Right. Not tlb, but more of memory subsystem stress. Typically changes to vm layout cant be done concurrently. Also, if the vm area is large, pages might be th
by majke 2y ago
Right. Not tlb, but more of memory subsystem stress. Typically changes to vm layout cant be done concurrently.
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.
- vlovich123 2y ago> 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.
- sirjee 2y agoLinux have madvise(MADV_DONTNEED).
- vlovich123 2y agoYou’re replying to a statement I wasn’t making and missing what I am saying. 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. https://news.ycombinator.com/item?id=23216590 https://news.ycombinator.com/item?id=23216590