logoalt Hacker News

10000truthstoday at 1:06 AM2 repliesview on HN

Which is why I said "allocate and pin". POSIX systems have mlock()/mlockall() to prefault allocated memory and prevent it from being paged out.


Replies

interroboinktoday at 2:04 AM

Random curious person here: does mlock() itself cause the pre-fault? Or do you have to scribble over that memory yourself, too?

(I understand that mlock prevents paging-out, but in my mind that's a separate concern from pre-faulting?)

show 1 reply
kibwentoday at 1:58 AM

Aha, my apologies, I overlooked that.