Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754188AbbGFKEC (ORCPT ); Mon, 6 Jul 2015 06:04:02 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:42798 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753723AbbGFKD7 (ORCPT ); Mon, 6 Jul 2015 06:03:59 -0400 Date: Mon, 6 Jul 2015 12:03:57 +0200 From: Pavel Machek To: "Rafael J. Wysocki" Cc: Len Brown , One Thousand Gnomes , Alan Stern , Linux PM list , "linux-kernel@vger.kernel.org" , Len Brown Subject: Re: [PATCH 1/1] suspend: delete sys_sync() Message-ID: <20150706100357.GA381@amd> References: <20150508201310.5c4ccfaa@lxorguk.ukuu.org.uk> <4290667.ZqInAykFGS@vostro.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4290667.ZqInAykFGS@vostro.rjw.lan> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1451 Lines: 34 Hi! > > Understand, however, there are systems which suspend/resume reliably > > many times per second, making policy choice of having the kernel hard-code > > a sys_sync() into the suspend path a bad idea. > > My current view on that is that whether or not to do a sync() before suspending > ultimately is a policy decision and should belong to user space as such (modulo > the autosleep situation when user space may not know when the suspend is going > to happen). > > Moreover, user space is free to do as many sync()s before suspending as it > wants to and the question here is whether or not the *kernel* should sync() > in the suspend code path. sync()s from userspace do not work, as userspace is still running. sync() from kernel happens with tasks stopped. ... so it should really get consistent image on disk. And there are already interfaces that can s2ram without sync, just use uswsusp ioctls, not the sysfs writes. If you are doing multiple suspends per second, a) you are doing something wrong and b) you'd better use ioctl anyway. Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- 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/