From owner-freebsd-hackers Tue Mar 5 13: 0:31 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from rwcrmhc53.attbi.com (rwcrmhc53.attbi.com [204.127.198.39]) by hub.freebsd.org (Postfix) with ESMTP id 4B15D37B402 for ; Tue, 5 Mar 2002 13:00:17 -0800 (PST) Received: from InterJet.elischer.org ([12.232.206.8]) by rwcrmhc53.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020305210016.SKDF2951.rwcrmhc53.attbi.com@InterJet.elischer.org>; Tue, 5 Mar 2002 21:00:16 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id MAA32421; Tue, 5 Mar 2002 12:55:30 -0800 (PST) Date: Tue, 5 Mar 2002 12:55:30 -0800 (PST) From: Julian Elischer To: Zhihui Zhang Cc: freebsd-hackers@freebsd.org Subject: Re: A weird disk behaviour In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG more writes fit in the disk's write cache? On Tue, 5 Mar 2002, Zhihui Zhang wrote: > > I am doing some raw I/O test on a seagate SCSI disk running FreeBSD 4.5. > This situation is like this: > > +-----+----+----+----+----+----+----+----+----+----+---+------ > | | | | | | | | | | | | .... > +-----+----+----+----+----+----+----+----+----+----+---+------ > > Each block is of fixed size, say 8192 bytes. Now I have a user program > writing each contiguously laid out block sequentially using /dev/daxxx > interface. There are a lot of them, say 15000. I write the blocks in two > ways (the data used in writing are garbage): > > (1) Write each block fully and sequentially, ie. 8192 bytes. > > (2) I still write these blocks sequentially, but for each block I only > write part of it. Exactly how many bytes are written inside each block is > determinted by a random number between 512 .. 8192 bytes (rounded up a > to multiple of 512 bytes). > > I find out the the performance of (2) is several times better than the > performance of (1). Can anyone explain to me why this is the case? > > Thanks for any suggestions or hints. > > -Zhihui > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message