From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 29 19:30:55 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E884816A4CE; Fri, 29 Oct 2004 19:30:55 +0000 (GMT) Received: from mail-svr1.cs.utah.edu (brahma.cs.utah.edu [155.98.64.200]) by mx1.FreeBSD.org (Postfix) with ESMTP id B61D543D39; Fri, 29 Oct 2004 19:30:55 +0000 (GMT) (envelope-from saggarwa@cs.utah.edu) Received: from faith.cs.utah.edu (faith.cs.utah.edu [155.98.65.40]) by mail-svr1.cs.utah.edu (Postfix) with ESMTP id E389E34846; Fri, 29 Oct 2004 13:30:40 -0600 (MDT) Received: by faith.cs.utah.edu (Postfix, from userid 4973) id B46D72EC21; Fri, 29 Oct 2004 13:30:38 -0600 (MDT) Received: from localhost (localhost [127.0.0.1]) by faith.cs.utah.edu (Postfix) with ESMTP id EB63734406; Fri, 29 Oct 2004 19:30:38 +0000 (UTC) Date: Fri, 29 Oct 2004 13:30:38 -0600 (MDT) From: Siddharth Aggarwal To: Don Lewis In-Reply-To: <200410291904.i9TJ1u0A026971@gw.catspoiler.org> Message-ID: References: <200410291904.i9TJ1u0A026971@gw.catspoiler.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@FreeBSD.org Subject: Re: flushing disk buffer cache X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Oct 2004 19:30:56 -0000 Thanks for your reply. Hmm. At the moment, the user can send an ioctl to define a checkpoint. But I would guess that this could happen between 2 strategy() function calls corresponding to the same filesystem operation? So if there a way to block filesystem operations while a snapshot is taken? I can't unmount an active filesystem before the snapshot and remount it after. Any suggestions? On Fri, 29 Oct 2004, Don Lewis wrote: > On 29 Oct, Siddharth Aggarwal wrote: > > > > Another related question ... > > > > Is it possible to delay or queue up disk writes until I exit from my > > function in the kernel (where I am trying to sync with the disk)? Or > > make sure that my sync function never goes to sleep waiting for the disk > > driver to signal completion of flushes to disk? > > Take a look at how the snapshot code handles this. It has to be done > above the level of individual disk operations because certain file > system operations require multiple disk I/O operations to transform the > file system from one consistent state to another consistent state. If > you try to checkpoint in the middle of this sequence, you will capture a > state where the file system is internally inconsistent. > > >