One of my favorite examples of userfaultfd: transparently mapping databases on cloud storage into RAM.<p><a href="https://tech.nextroll.com/blog/data/2016/11/29/traildb-mmap-s3.html" rel="nofollow">https://tech.nextroll.com/blog/data/2016/11/29/traildb-mmap-...</a>
A fun application of userfaultfd:<p><a href="https://github.com/whitequark/unfork" rel="nofollow">https://github.com/whitequark/unfork</a><p>Past discussions of unfork:<p><a href="https://news.ycombinator.com/item?id=21394678" rel="nofollow">https://news.ycombinator.com/item?id=21394678</a><p><a href="https://news.ycombinator.com/item?id=27287930" rel="nofollow">https://news.ycombinator.com/item?id=27287930</a>
It's a great feature, but it had a few unintended side-effects:<p><a href="https://lwn.net/Articles/819834/" rel="nofollow">https://lwn.net/Articles/819834/</a>
"Blocking userfaultfd() kernel-fault handling" (patches to fix a security issue, more detail in <a href="https://duasynt.com/blog/linux-kernel-heap-spray" rel="nofollow">https://duasynt.com/blog/linux-kernel-heap-spray</a>)<p><a href="https://lwn.net/Articles/849876/" rel="nofollow">https://lwn.net/Articles/849876/</a>
"Patching until the COWs come home" (complicated interaction with copy-on-write)
Possibly dumb question, but if I have some code that tries to blindly jump to, say, address 0x4000, would userfaultfd let me redirect accesses to 0x4000 to an address I've allocated elsewhere?