This interaction between mlockall and huge PROT_NONE mappings in the Linux kernel is a major annoyance:
lore.kernel.org/linux-mm/70885
Hope it turns out to be something that's easily fixable. It should be able to efficiently skip the entire mapping. It's unused, non-writable memory.
Conversation
Linux kernel seems to think that it's a good idea to fault in all of the possible pages for PROT_NONE mappings. Trying to do that for many terabytes of pages doesn't work out well. Result is very strange. Need to make time to look into what the kernel actually ends up doing...
1
3
It seems like it might hit a very high value and then stops trying to fault in more pages. Ends up causing new memory mappings to fail if locking is still enabled. The munlockall call is even more strange. I'm not sure why this feature would do anything with PROT_NONE mappings...
Replying to
This is a lot worse than the usual kernel API issues that I run into because I don't think there's anything I can do to work around it.
For other problems like mremap exposing bugs in the kernel's VMA merging implementation, I can avoid the pattern that ends up triggering it.
1
1
Show replies

