Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757115AbbGGNmp (ORCPT ); Tue, 7 Jul 2015 09:42:45 -0400 Received: from cantor2.suse.de ([195.135.220.15]:39214 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754787AbbGGNmi (ORCPT ); Tue, 7 Jul 2015 09:42:38 -0400 Date: Tue, 07 Jul 2015 15:42:35 +0200 Message-ID: From: Takashi Iwai To: Dave Chinner Cc: "Rafael J. Wysocki" , Len Brown , Henrique de Moraes Holschuh , Alan Stern , One Thousand Gnomes , Linux PM list , "linux-kernel@vger.kernel.org" , Len Brown Subject: Re: [PATCH 1/1] suspend: delete sys_sync() In-Reply-To: <20150707011756.GC3902@dastard> References: <4290667.ZqInAykFGS@vostro.rjw.lan> <1496051.AgsebokWnB@vostro.rjw.lan> <20150706000614.GB3902@dastard> <1595559.BsCkcDEfNB@vostro.rjw.lan> <20150707011756.GC3902@dastard> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.5 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2418 Lines: 59 At Tue, 7 Jul 2015 11:17:56 +1000, Dave Chinner wrote: > > > > > Moreover, question is if we really need to carry out the sync on *every* > > > > suspend even if it is not pointless overall. That shouldn't really be > > > > necessary if we suspend and resume often enough or if we resume only for > > > > a while and then suspend again. Maybe it should be rate limited somehow > > > > at least? > > > > > > If you suspend and resume frequently, then the cost of the sync > > > shoul dbe negliable because the amount of data dirtied between > > > resume/suspend shoul dbe negliable. hence my questions about where > > > sync is spending too much time, and whether we've actually fixed > > > those problems or not. If sync speed on clean filesystems is a > > > problem then we need to fix sync, not work around it. > > > > Well, say you never suspend, but you also only shut down the system when you > > need to replace the kernel on it. How often would you invoke global sync on > > that system? > > Never, because: > > - the kernel does background writeback of dirty data so you > don't need to run sync while the system is running; and > - unmount during shutdown runs sync_filesystem() internally > (just like sys_sync does) to ensure the filesystem is > clean and no data is lost. > > Seriously, stop being making ignorant arguments to justify removing > sys_sync(). *If* there's a problem sys_sync() we need to *fix it*, > not ignore it. This thread remembered me of an old problem I faced: suspend fails while copying a large file. So I tried again with 4.2-rc1. I put a slow USB stick with ext4, started copying a 4GB ISO file, and triggered the suspend. It failed. Then removed sys_sync(), and retested. It still failed. The log shows like: PM: Preparing system for sleep (freeze) Freezing user space processes ... (elapsed 0.002 seconds) done. Freezing remaining freezable tasks ... Freezing of tasks failed after 20.003 seconds (0 tasks refusing to freeze, wq_busy=1): Restarting kernel threads ... done. Restarting tasks ... done. So, removing sys_sync() will save a small amount of time, but it won't help always... Takashi -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/