Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1860395ybl; Sat, 14 Dec 2019 01:14:07 -0800 (PST) X-Google-Smtp-Source: APXvYqxbkc/KTqwAz7V3EOzz9VnLUwy3S1W4Z+QDq/2njo80RDa5hGG4ObC1BYXn2PgnPdLwsSSV X-Received: by 2002:a9d:6652:: with SMTP id q18mr19898682otm.321.1576314847569; Sat, 14 Dec 2019 01:14:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576314847; cv=none; d=google.com; s=arc-20160816; b=VEurCu65KxoRsXbblx7pWEhY3DWjj/u6yNm0q7Jq2nSW/roqHYonWwGxKz58zXfOOj GtRgATShgHqlI82eootMl9mmUsIWsCawVbUHBmkc1nIBX8qkj5i1539PvOhH9QPQSMt5 9Yn7w2zkopTQ2tpY4doIP9HTNsIo9S/TGfldrLfGGZEZLD+/mCyU737ReyX0mS8PSr9Q T7fY5IeE6Gd1qM3Z4D2W014xsnv09xWmAa6tNBchJlT+Puzz/ls8Eu74cGAGrHAKdnX0 ZZR8eauz1lT4tfmVzcAv91aN6vv/EICKzKdNQ7V8w9hXuH1JcccVn8rrvdiNdw8tcu1P TTnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Vdgsea7u0vDpdDbSHwlGs2r9aeeZIY6AXB1vf8eF7lw=; b=oP/np2uodEcFN/+q8ytP2EZugz49gQRZSVjH4cX1XRNEYWIT6ygxRpUfpZ2WFu180u ikrj0ZmOxM3IypKxwTylrOm+ZsCwvcUbEow9VN/NYTNTkElectkpmhuMEnzd4X7n/Mn8 tJ2e8lw9vgIWpx8jnGV+tkUs7JzgB2M/QeD3iSL7d12vGQyZo0r9/bXZzcXbQMqhjZvN HmONp3jTa6976gg26FhVVx3z0Xz7CJ2cXGmoBQo9ArC8tgCh+bsqwdJzdFkcjC5ReNAk 4uIOxzuEu3OoRnvTQQUyd3WiVl58hT5DWULEGCpxjO/WK514uUsAos+4gqF4/9dtdI2Z mLdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c13si7438968otd.109.2019.12.14.01.13.54; Sat, 14 Dec 2019 01:14:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725895AbfLNJNM (ORCPT + 99 others); Sat, 14 Dec 2019 04:13:12 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:38754 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725851AbfLNJNM (ORCPT ); Sat, 14 Dec 2019 04:13:12 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id DAF9A1C25E0; Sat, 14 Dec 2019 10:13:09 +0100 (CET) Date: Sat, 14 Dec 2019 10:13:09 +0100 From: Pavel Machek To: Jonas Meurer Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , Len Brown , Tim Dittler , Yannik Sembritzki Subject: Re: [PATCH 1/2] PM: Add a switch for disabling/enabling sync() before, suspend Message-ID: <20191214091309.GE16834@duo.ucw.cz> References: <1ee5b9ef-f30e-3fde-2325-ba516a96ced5@freesources.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AjmyJqqohANyBN/e" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --AjmyJqqohANyBN/e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > Signed-off-by: Jonas Meurer > --- > 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(-) >=20 > diff --git a/Documentation/ABI/testing/sysfs-power b/Documentation/ABI/te= sting/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 > 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 > +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 --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --AjmyJqqohANyBN/e Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCXfSnpQAKCRAw5/Bqldv6 8q6bAJ92QKXMCK/ZABzn9Z7P07mkVNnNEwCdH3hSEys6FZPbk5dgcCAUt/5PYAI= =GrT5 -----END PGP SIGNATURE----- --AjmyJqqohANyBN/e--