Re: [PATCH 1/1] suspend: delete sys_sync()
From: Pavel Machek <hidden>
Date: 2015-07-06 10:04:02
Also in:
lkml
Hi!
quoted
Understand, however, there are systems which suspend/resume reliably many times per second, making policy choice of having the kernel hard-code a sys_sync() into the suspend path a bad idea.My current view on that is that whether or not to do a sync() before suspending ultimately is a policy decision and should belong to user space as such (modulo the autosleep situation when user space may not know when the suspend is going to happen). Moreover, user space is free to do as many sync()s before suspending as it wants to and the question here is whether or not the *kernel* should sync() in the suspend code path.
sync()s from userspace do not work, as userspace is still running. sync() from kernel happens with tasks stopped. ... so it should really get consistent image on disk. And there are already interfaces that can s2ram without sync, just use uswsusp ioctls, not the sysfs writes. If you are doing multiple suspends per second, a) you are doing something wrong and b) you'd better use ioctl anyway. Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html