From owner-freebsd-current@FreeBSD.ORG Wed Jan 25 23:28:31 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 928FC106564A for ; Wed, 25 Jan 2012 23:28:31 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 03DDC8FC0C for ; Wed, 25 Jan 2012 23:28:30 +0000 (UTC) Received: from julian-mac.elischer.org (c-67-180-24-15.hsd1.ca.comcast.net [67.180.24.15]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id q0PMtj4X073477 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 25 Jan 2012 14:55:45 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <4F2088B7.7030308@freebsd.org> Date: Wed, 25 Jan 2012 14:56:55 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.25) Gecko/20111213 Thunderbird/3.1.17 MIME-Version: 1.0 To: John Baldwin References: <201201191739.48327.tijl@coosemans.org> <201201201412.13269.jhb@freebsd.org> <201201251129.22368.jhb@freebsd.org> In-Reply-To: <201201251129.22368.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org, Tijl Coosemans Subject: Re: posix_fadvise noreuse disables file caching X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 23:28:31 -0000 On 1/25/12 8:29 AM, John Baldwin wrote: > > So I've came up with this untested patch. It uses > VOP_ADVISE(FADV_DONTNEED) after read(2) calls to a NOREUSE region, and > leaves read-ahead caching enabled for NOREUSE. FADV_DONTNEED doesn't > do any good really for writes (it only flushes clean buffers), so I've > left write(2) operations as using IO_DIRECT still. Does this sound > reasonable? That sounds like a good solution. If people want something from write they can do it separately. For what it's worth, I would expect NOREUSE on write to still do write clustering but to free the buffer once it is written.