From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 19:53:36 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 3D2D216A4CE for ; Thu, 22 Apr 2004 19:53:36 -0700 (PDT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 23C4043D31 for ; Thu, 22 Apr 2004 19:53:36 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) i3N2rZ7Z004402; Thu, 22 Apr 2004 19:53:35 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.9p2/8.12.9/Submit) id i3N2rZ0t004401; Thu, 22 Apr 2004 19:53:35 -0700 (PDT) (envelope-from dillon) Date: Thu, 22 Apr 2004 19:53:35 -0700 (PDT) From: Matthew Dillon Message-Id: <200404230253.i3N2rZ0t004401@apollo.backplane.com> To: Stephan Uphoff , Julian Elischer References: <200404230103.VAA18066@stups.com> cc: hackers@freebsd.org Subject: Re: how to flush out 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, 23 Apr 2004 02:53:36 -0000 (taking hackers off to reduce noise) I think all that needs to happen to fix this problem is to call vm_object_page_remove() with the clean_only flag set to TRUE instead of FALSE. Wired pages, e.g. pages in the buffer cache, will not be removed, but that's ok because memory-mapped pages tend to not get buffer cache associations until the system decides to flush the pages. Fixing the buffer cache issue would have to occur in the actual VNODE I/O operation, which would only occur for VM_PROT_WRITE operations, which I think is just fine. The I/O op will have access to the invalidation request as a flag and it can simply do what NFS does which is flag the buffer to be destroyed on I/O completion. If that is done, then by the time we get to the second pass the buffer should be gone and the vm_object_page_remove() function will find a normal, unwired page and properly remove it. I'll test this out in DragonFly and email Stephan and Julian a followup. -Matt