From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Rafael J. Wysocki" Subject: Re: syncing the disks when entering sleep Date: Wed, 10 Feb 2010 19:42:43 +0100 Message-ID: <201002101942.43706.rjw@sisk.pl> References: <76FA3B279DD9DA48896E2B404944957204E0B241@USA7061MS02.na.xerox.net> <201002101158.22606.rjw@sisk.pl> <201002101202.54557.oliver@neukum.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <201002101202.54557.oliver@neukum.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-pm-bounces@lists.linux-foundation.org Errors-To: linux-pm-bounces@lists.linux-foundation.org To: Oliver Neukum Cc: linux-pm@lists.linux-foundation.org, Nigel Cunningham , "Leisner, Martin" List-Id: linux-pm@vger.kernel.org On Wednesday 10 February 2010, Oliver Neukum wrote: > Am Mittwoch, 10. Februar 2010 11:58:22 schrieb Rafael J. Wysocki: > > On Wednesday 10 February 2010, Oliver Neukum wrote: > > > Am Mittwoch, 10. Februar 2010 11:34:23 schrieb Rafael J. Wysocki: > > > > Actually, doing the sync() in the kernel is a hack that we decided not to > > > > remove just because the users space didin't do the right thing on some systems. > > > > If the user space always synced disks before suspending, we wouldn't have to > > > > do that in the kernel. > > > > > > If you sync in user space will you not have an inevitable race condition? > > > > Do you mean the race with applications that write to disks while the sustem is > > suspending? > > Yes. That would matter if sync meant mandatory flushing all data to the storage medium, but it doesn't. From a filesystem point of view it's an advisory thing, something like "I wish you flushed buffers right now". Rafael