Say I mmap a chunk of memory. Then I do mlockall(MCL_CURRENT | MCL_FUTURE) in order to lock everything. Then I munlock the original chunk.
mmap
mlockall(MCL_CURRENT | MCL_FUTURE)
munlock