From owner-freebsd-arch@FreeBSD.ORG Mon Nov 14 17:57:21 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28730106566C; Mon, 14 Nov 2011 17:57:21 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id F333D8FC15; Mon, 14 Nov 2011 17:57:20 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 9FB2046B51; Mon, 14 Nov 2011 12:57:20 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 484378A052; Mon, 14 Nov 2011 12:57:20 -0500 (EST) From: John Baldwin To: Bruce Cran Date: Mon, 14 Nov 2011 11:32:49 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: <201110281426.00013.jhb@freebsd.org> <201111080800.32717.jhb@freebsd.org> <4EBB104F.5010000@cran.org.uk> In-Reply-To: <4EBB104F.5010000@cran.org.uk> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201111141132.49616.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 14 Nov 2011 12:57:20 -0500 (EST) Cc: arch@freebsd.org, Ed Schouten , Alfred Perlstein , Jilles Tjoelker , freebsd-arch@freebsd.org Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 17:57:21 -0000 On Wednesday, November 09, 2011 6:44:15 pm Bruce Cran wrote: > On 08/11/2011 13:00, John Baldwin wrote: > > I think it would be fine to add flags to applications like 'tar' to > > allow users to alter their behavior in specific use cases when it > > makes sense. However, I think there are more workloads for 'tar' than > > the ones you are thinking of and we should be hesitant to change > > applications to use non- default settings. > > Someone's done that for GNU tar on Linux, adding a --no-oscache switch: > http://www.mysqlperformanceblog.com/2010/04/02/fadvise-may-be-not-what-you- expect/ > . I think this would be a fine extension to add. You could do it just by using O_DIRECT though, no need for fadvise(). (FADV_NOREUSE effectively forces O_DIRECT on, so if you want to use it for the entire file, you can just use O_DIRECT). However, the application should be very careful to only read full FS blocks on block-aligned boundaries (using fs_bsize from stat) to avoid excessive I/O operations. -- John Baldwin