How does mlock() work with hibernation?

408 views Asked by At

Quoting the Linux Programmer's Manual (man 2 mlock):

mlock(), mlock2(), and mlockall() lock part or all of the calling process's virtual address space into RAM, preventing that memory from being paged to the swap area.

How does this work with respect to hibernation? Can a process using mlock() be hibernated at all? What are the semantics after resuming from hibernation?

1

There are 1 answers

0
Yaroslav Nikitenko On

It depends on your system. Linux manual for mlock says:

Be aware that the suspend mode on laptops and some desktop computers will save a copy of the system's RAM to disk, regardless of memory locks.

Some tools are really affected by mlock:

1- I hibernate the laptop with Armory opened.
2- I back from hibernate.
3- Armory doesnt syncronize. (To syncronize again I need to restart Armory).