From owner-freebsd-performance@FreeBSD.ORG Fri Dec 22 02:31:42 2006 Return-Path: X-Original-To: freebsd-performance@freebsd.org Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0012B16A416 for ; Fri, 22 Dec 2006 02:31:41 +0000 (UTC) (envelope-from markir@paradise.net.nz) Received: from smtp3.clear.net.nz (smtp3.clear.net.nz [203.97.33.64]) by mx1.freebsd.org (Postfix) with ESMTP id B9E2F13C455 for ; Fri, 22 Dec 2006 02:31:41 +0000 (UTC) (envelope-from markir@paradise.net.nz) Received: from [192.168.1.11] (121-72-65-158.dsl.telstraclear.net [121.72.65.158]) by smtp3.clear.net.nz (CLEAR Net Mail) with ESMTP id <0JAN00BS2LOO3200@smtp3.clear.net.nz>; Fri, 22 Dec 2006 15:31:36 +1300 (NZDT) Date: Fri, 22 Dec 2006 15:31:35 +1300 From: Mark Kirkwood In-reply-to: <458B3E0C.6090104@freebsd.org> To: David Xu Message-id: <458B4387.9090409@paradise.net.nz> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit References: <458B3651.8090601@paradise.net.nz> <458B3E0C.6090104@freebsd.org> User-Agent: Thunderbird 1.5.0.8 (X11/20061129) Cc: freebsd-performance@freebsd.org Subject: Re: Cached file read performance X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Dec 2006 02:31:42 -0000 David Xu wrote: > Mark Kirkwood wrote: >> I recently did some testing on the performance of cached reads using >> two (almost identical) systems, one running FreeBSD 6.2PRE and the >> other running Gentoo Linux - the latter acting as a control. I >> initially started a thread of the same name on -stable, but it was >> suggested I submit a mail here. >> >> My background for wanting to examine this is that I work with >> developing database software (postgres internals related) and cached >> read performance is pretty important - since we typically try hard to >> encourage cached access whenever possible. >> >> Anyway on to the results: I used the attached program to read a cached >> 781MB file sequentially and randomly with a specified block size (see >> below). The conclusion I came to was that our (i.e FreeBSD) cached >> read performance (particularly for smaller block sizes) could perhaps >> be improved... now I'm happy to help in any way - the machine I've got >> running STABLE can be upgraded to CURRENT in order to try out patches >> (or in fact to see if CURRENT is faster at this already!)... >> >> Best wishes >> >> Mark >> > > I suspect in such a test, memory copying speed will be a key factor, > I don't have number to back up my idea, but I think Linux has lots > of tweaks, such as using MMX instruction to copy data. > > Regards, > David Xu > David - very interesting - checking 2.6.18 sources I see: arch/i386/lib/memcpy.c:7-> void *memcpy(void *to, const void *from, size_t n) { #ifdef CONFIG_X86_USE_3DNOW return __memcpy3d(to, from, n); #else return __memcpy(to, from, n); #endif } If I understand this correctly, I need CONFIG_X86_USE_3DNOW (or perhaps CONFIG_M586MMX) set in my Linux kernel config to be using these.... which I don't appear to have (I'll do some more digging and see if maybe profiling tells us anything useful). Cheers Mark