From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 27 09:40:18 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 55E391065698; Wed, 27 Oct 2010 09:40:18 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [199.26.172.34]) by mx1.freebsd.org (Postfix) with ESMTP id 344648FC16; Wed, 27 Oct 2010 09:40:17 +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 o9R9BFM5027735 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 27 Oct 2010 02:11:15 -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 o9R9BFUb027734; Wed, 27 Oct 2010 02:11:15 -0700 (PDT) Received: from fbsd61 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA09065; Wed, 27 Oct 10 02:01:09 PDT Date: Wed, 27 Oct 2010 02:00:51 -0700 From: perryh@pluto.rain.com To: ivoras@freebsd.org Message-Id: <4cc7ea44.ApOaxS8Xr4Sxu+0x%perryh@pluto.rain.com> References: <20101026213618.GA3013@freebsd.org> 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: Wed, 27 Oct 2010 09:40:18 -0000 Ivan Voras wrote: > fsync(2) actually does behave as advertised, "auses all modified > data and attributes of fd to be moved to a permanent storage > device". It is the problem of the "permanent storage device" > if it caches this data further. IMO, volatile RAM without battery backup cannot reasonably be considered a "permanent storage device", regardless of where it is physically located. Short of mounting synchronously, with the attendant performance hit, would it not make sense for fsync(2) to issue ATA_FLUSHCACHE or SCSI "SYNCHRONIZE CACHE" after it has finished writing data to the drive? Surely the low-level capability to issue those commands must already exist, else we would have no way to safely prepare for power off.