Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751962AbbEKBpH (ORCPT ); Sun, 10 May 2015 21:45:07 -0400 Received: from ipmail06.adl6.internode.on.net ([150.101.137.145]:5953 "EHLO ipmail06.adl6.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751298AbbEKBpC (ORCPT ); Sun, 10 May 2015 21:45:02 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BTCADhCFBVPPDOLHlcgw+BMoJQg3ysJAEGmVUCAgEBAoEjTQEBAQEBAQcBAQEBQT+EIAEBAQMBOhwjEAgDFQMJJQ8FJQMHGhOIJAfGYQEBAQcCAR8YhX6FI4QcGk8HgxeBFgWdH4Elg1qHaoYag1WBBIEFgiMsMYEDI4EgAQEB Date: Mon, 11 May 2015 11:44:28 +1000 From: Dave Chinner To: Len Brown Cc: rjw@rjwysocki.net, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Len Brown Subject: Re: [PATCH 1/1] suspend: delete sys_sync() Message-ID: <20150511014428.GB15721@dastard> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1886 Lines: 48 On Fri, May 08, 2015 at 03:08:43AM -0400, Len Brown wrote: > From: Len Brown > > Remove sys_sync() from the kernel's suspend flow. > > sys_sync() is extremely expensive in some configurations, > and so the kernel should not force users to pay this cost > on every suspend. Since when? Please explain what your use case is that makes this so prohibitively expensive it needs to be removed. > > The user-space utilities s2ram and s2disk choose to invoke sync() today. > A user can invoke suspend directly via /sys/power/state to skip that cost. So, you want to have s2disk write all the dirty pages in memory to the suspend image, rather than to the filesystem? Either way you have to write that dirty data to disk, but if you write it to the suspend image, it then has to be loaded again on resume, and then written again to the filesystem the system has resumed. This doesn't seem very efficient to me.... And, quite frankly, machines fail to resume from suspne dall the time. e.g. run out of batteries when they are under s2ram conditions, or s2disk fails because a kernel upgrade was done before the s2disk and so can't be resumed. With your change, users lose all the data that was buffered in memory before suspend, whereas right now it is written to disk and so nothing is lost if the resume from suspend fails for whatever reason. IOWs, I can see several good reasons why the sys_sync() needs to remain in the suspend code. User data safety and filesystem integrity is far, far more important than a couple of seconds improvement in suspend speed.... Cheers, Dave. -- Dave Chinner david@fromorbit.com -- 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/