Skip to contentSkip to conversation

Suspend to RAM - freeze & sync

DISCUSSION Radek Pilar 2 participants 2 messages Jan 18, 2013 – Oct 8, 2013

lore
Share & tools
lore
#0 lore raw

Hello,
I'm trying to implement feature that removes cryptsetup keys from RAM on suspend to RAM: mounts ramfs, unpacks initramfs to ramfs, moves /proc /dev and /sys to ramfs, chroots, calls luksSuspend, suspends system using /sys/power/state, after resume calls luksResume and cleans up. However, there is a small issue I wasn't able to solve: after calling luksSuspend, all attempts to access suspended device blocks - so most likely some processes won't be able to freeze. The same issue will be with sync just before suspend - if there are some data to be written, sync() blocks. If I comment out freeze and sync from the suspend code, it suspends (and wakes up) just fine - however, that patch will never be accepted.
Is there any *correct* way to do this? (Skip freeze/sync on demand)? Thanks
Radek Pilar

#1 lore raw

Hi!

Quoted 4 lines

I'm trying to implement feature that removes cryptsetup keys from RAM on suspend to RAM: mounts ramfs, unpacks initramfs to ramfs, moves /proc /dev and /sys to ramfs, chroots, calls luksSuspend, suspends system using /sys/power/state, after resume calls luksResume and cleans up.

Quoted 8 lines

However, there is a small issue I wasn't able to solve: after calling luksSuspend, all attempts to access suspended device blocks - so most likely some processes won't be able to freeze. The same issue will be with sync just before suspend - if there are some data to be written, sync() blocks. If I comment out freeze and sync from the suspend code, it suspends (and wakes up) just fine - however, that patch will never be accepted.
Is there any *correct* way to do this? (Skip freeze/sync on demand)?

Maybe uswsusp interface is powerful enough to do this?
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html