From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60E99C35240 for ; Thu, 30 Jan 2020 12:19:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 348F4206D3 for ; Thu, 30 Jan 2020 12:19:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727184AbgA3MT1 (ORCPT ); Thu, 30 Jan 2020 07:19:27 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:56500 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726873AbgA3MT1 (ORCPT ); Thu, 30 Jan 2020 07:19:27 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 1A7F41C2604; Thu, 30 Jan 2020 13:19:26 +0100 (CET) Date: Thu, 30 Jan 2020 13:19:26 +0100 From: Pavel Machek To: "Rafael J. Wysocki" Cc: Jonas Meurer , "Rafael J. Wysocki" , Linux Kernel Mailing List , Linux PM , Len Brown , Tim Dittler , Yannik Sembritzki Subject: Re: [PATCH v3] PM: suspend: Add sysfs attribute to control the "sync on suspend" behavior Message-ID: <20200130121926.cdz7dtrcbeuodqca@ucw.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! > > The sysfs attribute `/sys/power/sync_on_suspend` controls, whether or not > > filesystems are synced by the kernel before system suspend. > > > > Congruously, the behaviour of build-time switch CONFIG_SUSPEND_SKIP_SYNC > > is slightly changed: It now defines the run-tim default for the new sysfs > > attribute `/sys/power/sync_on_suspend`. > > > > The run-time attribute is added because the existing corresponding > > build-time Kconfig flag for (`CONFIG_SUSPEND_SKIP_SYNC`) is not flexible > > enough. E.g. Linux distributions that provide pre-compiled kernels > > usually want to stick with the default (sync filesystems before suspend) > > but under special conditions this needs to be changed. > > > > One example for such a special condition is user-space handling of > > suspending block devices (e.g. using `cryptsetup luksSuspend` or `dmsetup > > suspend`) before system suspend. The Kernel trying to sync filesystems > > after the underlying block device already got suspended obviously leads > > to dead-locks. Be aware that you have to take care of the filesystem sync > > yourself before suspending the system in those scenarios. > > > > Signed-off-by: Jonas Meurer > > Applied as 5.6 material with minor changes in the ABI document, thanks! For the record, I still believe this is bad idea. User should not have to tweak variables in /sys for system not to deadlock with cryptsetup.. and we are stuck with this pretty much forever. Pavel