linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Jonas Meurer <jonas@freesources.org>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <len.brown@intel.com>,
	Tim Dittler <tim.dittler@systemli.org>,
	Yannik Sembritzki <yannik@sembritzki.me>
Subject: Re: [PATCH 1/2] PM: Add a switch for disabling/enabling sync() before, suspend
Date: Sat, 14 Dec 2019 10:13:09 +0100	[thread overview]
Message-ID: <20191214091309.GE16834@duo.ucw.cz> (raw)
In-Reply-To: <fceb198d-af5b-4d2e-ca55-8232295b202d@freesources.org>

[-- Attachment #1: Type: text/plain, Size: 2099 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2019-12-14  9:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-02 17:05 [PATCH 0/2] PM: Add a switch for disabling/enabling sync() before suspend Jonas Meurer
2019-12-02 17:07 ` [PATCH 1/2] PM: Add a switch for disabling/enabling sync() before, suspend Jonas Meurer
2019-12-14  9:13   ` Pavel Machek [this message]
2019-12-16 16:54     ` Jonas Meurer
2019-12-02 17:07 ` [PATCH 2/2] PM: CONFIG_SUSPEND_SKIP_SYNC sets default for, '/sys/power/sync_on_suspend' Jonas Meurer
2019-12-20  9:35   ` Rafael J. Wysocki
2019-12-20 16:06     ` Jonas Meurer
2019-12-11 15:59 ` [PATCH 0/2] PM: Add a switch for disabling/enabling sync() before suspend Jonas Meurer
2019-12-12 18:00   ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191214091309.GE16834@duo.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=jonas@freesources.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=tim.dittler@systemli.org \
    --cc=yannik@sembritzki.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).