From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Friesen Subject: Re: [sqlite] light weight write barriers Date: Thu, 15 Nov 2012 16:35:47 -0600 Message-ID: <50A56E43.3040805@genband.com> References: <5086F5A7.9090406@vlnb.net> <20121025051445.GA9860@thunk.org> <508B3EED.2080003@vlnb.net> <20121027044456.GA2764@thunk.org> <5090532D.4050902@vlnb.net> <20121031095404.0ac18a4b@pyramind.ukuu.org.uk> <5092D90F.7020105@vlnb.net> <20121101212418.140e3a82@pyramind.ukuu.org.uk> <50931601.4060102@symas.com> <20121102123359.2479a7dc@pyramind.ukuu.org.uk> <50A1C15E.2080605@vlnb.net> <20121113174000.6457a68b@pyramind.ukuu.org.uk> <50A442AF.9020407@vlnb.net> <50A52133.9050204@cs.utoronto.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: General Discussion of SQLite Database , Vladislav Bolkhovitin , Nico Williams , linux-fsdevel@vger.kernel.org, Theodore Ts'o , linux-kernel , Richard Hipp To: Ryan Johnson Return-path: In-Reply-To: <50A52133.9050204@cs.utoronto.ca> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On 11/15/2012 11:06 AM, Ryan Johnson wrote: > The easiest way to implement this fsync would involve three things: > 1. Schedule writes for all dirty pages in the fs cache that belong to > the affected file, wait for the device to report success, issue a cache > flush to the device (or request ordering commands, if available) to make > it tell the truth, and wait for the device to report success. AFAIK this > already happens, but without taking advantage of any request ordering > commands. > 2. The requesting thread returns as soon as the kernel has identified > all data that will be written back. This is new, but pretty similar to > what AIO already does. > 3. No write is allowed to enqueue any requests at the device that > involve the same file, until all outstanding fsync complete [3]. This is > new. This sounds interesting as a way to expose some useful semantics to userspace. I assume we'd need to come up with a new syscall or something since it doesn't match the behaviour of posix fsync(). Chris