mmap in Go considered harmful

13 points by runxiyu


jtolio

Note that this blog post is from 2018, which is before changes to Go's preemption strategy. Check out this 2020 GopherCon talk about how Go handles preemption these days: https://www.youtube.com/watch?v=1I1WmeSjRSw

runxiyu

Oh, apparently go may require prefaulting mmap is similar

shanemhansen

So crazily enough, I've been thinking about this exact blog post for over a decade. Ever since I thought "hey, a page fault on swap would probably really mess up the go scheduler because it's really going to block the underlying thread (M in go terminology iirc properly)".

Thanks to Valyala for writing this and sharing!