From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 28 08:11:32 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 955CF106564A; Thu, 28 Oct 2010 08:11:32 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [IPv6:2607:f678:1010::34]) by mx1.freebsd.org (Postfix) with ESMTP id 3BB0B8FC0A; Thu, 28 Oct 2010 08:11:32 +0000 (UTC) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id o9S8BVFr069241 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 28 Oct 2010 01:11:31 -0700 (PDT) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.12.9/Submit) with UUCP id o9S8BVKe069240; Thu, 28 Oct 2010 01:11:31 -0700 (PDT) Received: from fbsd61 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA13450; Thu, 28 Oct 10 01:02:13 PDT Date: Thu, 28 Oct 2010 01:01:53 -0700 From: perryh@pluto.rain.com To: ivoras@freebsd.org Message-Id: <4cc92df1.Z0CRaJOCdvd/ZJSL%perryh@pluto.rain.com> References: <20101026213618.GA3013@freebsd.org> <4cc7ea44.ApOaxS8Xr4Sxu+0x%perryh@pluto.rain.com> <20101027111124.00007450@unknown> In-Reply-To: User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: fsync(2) manual and hdd write caching X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Oct 2010 08:11:32 -0000 Ivan Voras wrote: > ... The problem is actually pretty hard - since AFAIK SoftUpdates > doesn't have "checkpoints" in the sense that it groups writes and > all data "before" can guaranteed to be on-disk, the problem is > *when* to issue BIO_FLUSH requests. Seems to me the originally-stated problem -- making fsync(2) do what it claims to do -- is not hard at all. Just issue a BIO_FLUSH request as the final step in handling fsync(2). While we're at it, perhaps do the same in close(2). I _hope_ we are already doing it in unmount(2).