Re: [PATCH 1/1] suspend: delete sys_sync()
From: One Thousand Gnomes <hidden>
Date: 2015-05-15 10:36:26
Also in:
lkml
quoted
Data loss may be caused for hotplug storage(like USB), or all storage when power is exhausted during suspend.Which also may very well happen at run time, right?
Intuitively users treat "suspended" as a bit like off and do remove devices they've "finished with". Technically yes the instant off/on on a phone is the same as the suspend to RAM on a laptop but it doesn't mean the model in people's heads is the same... not yet anyway.
quoted
Is there obvious advantage to remove sys_sync() in the case?Yes, there is. It is not necessary to sync() every time you suspend if you do that very often.
But if you do it very often you won't have any dirty pages to flush so it will be very fast.
And it is done in such a place that everything needs to wait for it to complete.
Only because the code deciding to trigger any automated suspend doesn't do a sync a few seconds before. In the case the user goes to the menus and does power->suspend then yes it's a delay. In the case where the OS at some level has decided that it's 10 seconds from automatically suspending to something the user space can issue a pre-emptive sync to get the queue size down. Alan