Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933966AbbEOKg0 (ORCPT ); Fri, 15 May 2015 06:36:26 -0400 Received: from 251.110.2.81.in-addr.arpa ([81.2.110.251]:55459 "EHLO lxorguk.ukuu.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753678AbbEOKgX (ORCPT ); Fri, 15 May 2015 06:36:23 -0400 Date: Fri, 15 May 2015 11:35:57 +0100 From: One Thousand Gnomes To: "Rafael J. Wysocki" Cc: Ming Lei , "Rafael J. Wysocki" , Dave Chinner , NeilBrown , Len Brown , Linux PM List , Linux Kernel Mailing List , Len Brown Subject: Re: [PATCH 1/1] suspend: delete sys_sync() Message-ID: <20150515113557.54ef930b@lxorguk.ukuu.org.uk> In-Reply-To: References: <20150514092251.6d0625af@notabene.brown> <20150514235426.GF4316@dastard> <3798672.EXej90jOp1@vostro.rjw.lan> Organization: Intel Corporation X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.27; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1425 Lines: 35 > > Data loss may be caused for hotplug storage(like USB), or all storage > > when power is exhausted during suspend. > > Which also may very well happen at run time, right? Intuitively users treat "suspended" as a bit like off and do remove devices they've "finished with". Technically yes the instant off/on on a phone is the same as the suspend to RAM on a laptop but it doesn't mean the model in people's heads is the same... not yet anyway. > > Is there obvious advantage to remove sys_sync() in the case? > > Yes, there is. It is not necessary to sync() every time you suspend > if you do that very often. But if you do it very often you won't have any dirty pages to flush so it will be very fast. > And it is done in such a place that everything needs to wait for it to complete. Only because the code deciding to trigger any automated suspend doesn't do a sync a few seconds before. In the case the user goes to the menus and does power->suspend then yes it's a delay. In the case where the OS at some level has decided that it's 10 seconds from automatically suspending to something the user space can issue a pre-emptive sync to get the queue size down. Alan -- 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/