From owner-freebsd-fs Fri Jan 4 15:28:36 2002 Delivered-To: freebsd-fs@freebsd.org Received: from elvis.mu.org (elvis.mu.org [216.33.66.196]) by hub.freebsd.org (Postfix) with ESMTP id ADD2837B41B; Fri, 4 Jan 2002 15:28:33 -0800 (PST) Received: by elvis.mu.org (Postfix, from userid 1192) id 6CABC81E0C; Fri, 4 Jan 2002 17:28:33 -0600 (CST) Date: Fri, 4 Jan 2002 17:28:33 -0600 From: Alfred Perlstein To: dillon@freebsd.org Cc: fs@freebsd.org Subject: open("", O_DIRECT) broken. Message-ID: <20020104172833.R82406@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Open passed the O_DIRECT flag seems broken, instead of doing the right thing which would be just to penalize buffers not in the cache, what it does (at least from casual observation in ufs_readwrite) is mark _all_ buffers read via a O_DIRECT file as wanting to be discarded, this is bogus as you may read via an O_DIRECT method the entire file and invalidate the cache of another process accessing the same file. It would be much better to pass O_DIRECT down to bread{n} which would only mark it as B_DIRECT if it's not found in the cache. The idea is to not be distruptive to the cache, not to prematurely toss away buffers that may be otherwise benifiting from heavy cache utilization. -- -Alfred Perlstein [alfred@freebsd.org] 'Instead of asking why a piece of software is using "1970s technology," start asking why software is ignoring 30 years of accumulated wisdom.' Tax deductable donations for FreeBSD: http://www.freebsdfoundation.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message