From owner-freebsd-fs@FreeBSD.ORG Tue Aug 31 10:08:30 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8546A10656A4 for ; Tue, 31 Aug 2010 10:08:30 +0000 (UTC) (envelope-from gljennjohn@googlemail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 15B098FC0A for ; Tue, 31 Aug 2010 10:08:29 +0000 (UTC) Received: by fxm4 with SMTP id 4so4422949fxm.13 for ; Tue, 31 Aug 2010 03:08:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:reply-to:x-mailer:mime-version :content-type:content-transfer-encoding; bh=TJUXauNGbOByVh7o0kpLzcqsg+MLEAKbCPOjRkwSFHA=; b=qMwxOT8HCWL0BYtWJBNnkzrBV4yIQJmI3NIk29dC7e4NCbCr3IdZD0rJDjypD6t9q3 lCfpg1TBtnKAqRpNGS5n+grWuQNx0pf4sBcUaes7wWU5Z90D9yfQVuJcAhDhhs63Jyyg 8O2/nIFXdY2vo9VvLKHwJlHWsn0LAOefIgF78= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :x-mailer:mime-version:content-type:content-transfer-encoding; b=gwj8bNcb9BvcuPPvC0q18snzcWeuAR6LVj06/ST8/OGcvNux+I7v7rj00rwCrLAZTd q+YEGHqOMLjurU4TqN4G4sIv2nIYe+6UYWwcfOOFuKXslIRct8dR1ZkOp6rdSvVrdEbA MnJyDgARDBbNo1zbxjRv/X17KiQRIOX5tIsug= Received: by 10.223.108.81 with SMTP id e17mr5118185fap.28.1283247533629; Tue, 31 Aug 2010 02:38:53 -0700 (PDT) Received: from ernst.jennejohn.org (p578E3809.dip.t-dialin.net [87.142.56.9]) by mx.google.com with ESMTPS id 14sm3855139fav.2.2010.08.31.02.38.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 31 Aug 2010 02:38:52 -0700 (PDT) Date: Tue, 31 Aug 2010 11:38:51 +0200 From: Gary Jennejohn To: Martin Cracauer Message-ID: <20100831113851.6d449628@ernst.jennejohn.org> In-Reply-To: <20100830225841.GA9363@cons.org> References: <20100830225841.GA9363@cons.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.7; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-fs@freebsd.org Subject: Re: fsync(2) and on-disk write-back cache X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gljennjohn@googlemail.com List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Aug 2010 10:08:30 -0000 On Mon, 30 Aug 2010 18:58:42 -0400 Martin Cracauer wrote: > I always assumed the answer to this question is "of course": > > When doing an fsync (waiting for the commit), do we actually tell the > disk to flush the on-disk write-back cache (if that is in use) to the > platters? > > I just went down some code paths in both FreeBSD and Linux and in both > cases the paths for fsync quickly disappear in the generic > block-by-block flushing code that is also used for regular (non-fsync) > flushing. I didn't see anything aware of the on-disk cache. > I may be wrong, but it seems to me that the actual cache flush on the disk is handled at a very low level - in the drivers. At least I'm pretty certain that e.g. the ahci code sends flush commands to the disks. -- Gary Jennejohn