tuxonice fails if more than 50% of mem is used
On a machine with 1GB of RAM, the script at https://gist.github.com/mschlaeffer/8f343624973ab889e6c8 will fail after about 5 suspend-resume cycles if called by ./tuxonice-cycle.sh 10 100M.
I get this problem on my laptop and inside a VM, for at least Linux versions 4.2, 4.3 and 4.4. The problem occurs on Ubuntu with the Ubuntu kernel config but otherwise unmodified tuxonice-kernel code.
Steps to reproduce:
- checkout the tuxonice-4.2 branch (commit f81a8ec)
- copy https://gist.github.com/mschlaeffer/4b82a62a4b92541e8cea to
.configand runmake olddefconfig - build, install and setup the tuxonice kernel
- install the tools
pm-utilsandstress - run
./tuxonice-cycle.sh 10 100M
Thanks Martin. Those are great instructions! I'll give them a go right now.
Woohoo! You've found a bug! When preparing an image, we may need to seek to free memory. As part of that, we put extreme pressure on the VM, sucking up every free page in sight. The bug is that when we go to update our calculations, some of the code was seeking to do memory allocation - and therefore hanging. Both of the code paths I've found so far that do this call out to the UUID code, so the solution has been to invoke it once at the start of the cycle, storing the result in a static variable and using that until the next cycle. I'm going to tweak this a little before committing the fix - I'm conscious that if you're mounting or unmounting a filesystem when the cycle starts, the amount could end up being wrong.
Hi Nigel, could you commit your fix in a development branch and push it to github, even if it is not ready? People seem motivated here (including me) to work on tuxonice themselves, with a little assistance by you. Thanks