lkml.org 
[lkml]   [2019]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] PM: Add a switch for disabling/enabling sync() before, suspend
On Mon 2019-12-02 18:07:05, Jonas Meurer wrote:
> The switch allows to enable or disable the final sync() from the suspend.c
> Linux Kernel system suspend implementation. This is useful to avoid race
> conditions if block devices have been suspended before. Be aware that you
> have to take care of sync() yourself before suspending the system if you
> disable it here.
>
> Signed-off-by: Jonas Meurer <jonas@freesources.org>
> ---
> Documentation/ABI/testing/sysfs-power | 14 ++++++++++++
> include/linux/suspend.h | 2 ++
> kernel/power/main.c | 33 +++++++++++++++++++++++++++
> kernel/power/suspend.c | 2 +-
> 4 files changed, 50 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/ABI/testing/sysfs-power b/Documentation/ABI/testing/sysfs-power
> index 6f87b9dd384b..f164a364e89a 100644
> --- a/Documentation/ABI/testing/sysfs-power
> +++ b/Documentation/ABI/testing/sysfs-power
> @@ -407,3 +407,17 @@ Contact: Kalesh Singh <kaleshsingh96@gmail.com>
> Description:
> The /sys/power/suspend_stats/last_failed_step file contains
> the last failed step in the suspend/resume path.
> +
> +What: /sys/power/sync_on_suspend
> +Date: October 2019
> +Contact: Jonas Meurer <jonas@freesources.org>
> +Description:
> + This file controls the switch to enable or disable the final
> + sync() before system suspend. This is useful to avoid race
> + conditions if block devices have been suspended before. Be
> + aware that you have to take care of sync() yourself before
> + suspending the system if you disable it here.
> +
> + Writing a "1" (default) to this file enables the sync() and
> + writing a "0" disables it. Reads from the file return the
> + current value.

This pushes kernel's responsibility on the user, and adds to the mess
we already have there.

Just... don't do it? Move sync somewhere where it can be done?

Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2019-12-14 10:14    [W:0.069 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site