Date: Tue, 04 Nov 2008 09:32:51 -0700 From: Scott Long <scottl@samsco.org> To: "Patrick M. Hausen" <hausen@punkt.de> Cc: stable@freebsd.org, d_elbracht <d_elbracht@ecngs.de> Subject: Re: Block device Message-ID: <49107933.7070907@samsco.org> In-Reply-To: <20081104145144.GB14539@hugo10.ka.punkt.de> References: <d3ea75b30811040612g3ba10a8fuf5551b730176acc2@mail.gmail.com> <004901c93e8a$1b556500$639049d9@EC1a> <20081104145144.GB14539@hugo10.ka.punkt.de>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?49107933.7070907>