From owner-freebsd-stable@FreeBSD.ORG Wed Nov 5 00:04:43 2008 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AC25106567F for ; Wed, 5 Nov 2008 00:04:43 +0000 (UTC) (envelope-from ronald-freebsd8@klop.yi.org) Received: from smtp-out1.tiscali.nl (smtp-out1.tiscali.nl [195.241.79.176]) by mx1.freebsd.org (Postfix) with ESMTP id D1D0D8FC08 for ; Wed, 5 Nov 2008 00:04:42 +0000 (UTC) (envelope-from ronald-freebsd8@klop.yi.org) Received: from [212.123.145.58] (helo=guido.klop.ws) by smtp-out1.tiscali.nl with smtp id 1KxVbr-0008Fh-04 for ; Wed, 05 Nov 2008 00:46:55 +0100 Received: (qmail 54689 invoked from network); 4 Nov 2008 23:46:54 -0000 Received: from localhost (HELO 82-170-177-25.ip.telfort.nl) (127.0.0.1) by localhost with SMTP; 4 Nov 2008 23:46:54 -0000 Date: Wed, 05 Nov 2008 00:46:52 +0100 To: "Scott Long" , "Patrick M. Hausen" From: "Ronald Klop" Content-Type: text/plain; format=flowed; delsp=yes; charset=us-ascii MIME-Version: 1.0 References: <004901c93e8a$1b556500$639049d9@EC1a> <20081104145144.GB14539@hugo10.ka.punkt.de> <49107933.7070907@samsco.org> Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: <49107933.7070907@samsco.org> User-Agent: Opera Mail/9.62 (FreeBSD) Cc: stable@freebsd.org, d_elbracht Subject: Re: Block device X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 00:04:43 -0000 On Tue, 04 Nov 2008 17:32:51 +0100, Scott Long wrote: > Patrick M. Hausen wrote: >> h, all, >> On Tue, Nov 04, 2008 at 03:32:01PM +0100, d_elbracht wrote: >>> Hi list, >>> >>> can someone please explain, why stat -x /dev/da1 >>> >>> show the SCSI-Drive as a character-device ? >> >> http://www.freebsd.org/doc/en/books/arch-handbook/driverbasics-block.html >> > > Wow that's a confusing and misleading article. > > 1. disk access in the driver layer still happens on a block basis. It's > true that to the application layer, the device has character dev > semantics, meaning that arbitrary numbers of bytes can be accessed > randomly without any restrictions. But deep down inside the kernel, > it's still doing block-by-block access. > > 2. caching still happens at the filesystem level. Doing I/O directly to > /dev/daX or adX or whatever will not be cached/buffered, but doing I/O > to a file on any of these devices will. > > 3. Cache coherency between the block and character device > representations was indeed an issue, but removing the block/cached > representation was really a matter of policy over tools, and it's > one reason why FreeBSD gets creamed in the silly-io-benchmarch > department. > > 4. However, in the not-so-silly-io-benchmark department, I think FreeBSD > does a whole lot better because you don't have the blind caching of the > block device trying to out-guess what the filesystem is trying to do. > > Scott This explains some things to me as a simple user reading the linked article. I'm not a kernel programmer, but do understand computers and this article made me wonder if I missed something last years about disks and caches. Ronald.