Date: Fri, 8 Oct 1999 19:06:30 -0700 (PDT) From: Julian Elischer <julian@whistle.com> To: arch@freebsd.org Cc: mckusick@mckusick.com, core@freebsd.org Subject: The eventual fate of BLOCK devices. Message-ID: <Pine.BSF.4.10.9910081840300.8009-100000@current1.whistle.com>
next in thread | raw e-mail | index | archive | help
There has been lot of movement on the device interface within the kernel recently. One of the things that has been going on is the removal of block device references. I spoke with Kirk for a point of view an dhe indicated that historically they were an accident and that he thought that they could probably be gotten rid of. to quote him: --------------- Q: Can you give us some hints as to how you envision the world? A: Every device is a character device. ------------------------- DG has also given an opinion on this topic.. which is: --------------------------- Well, for one thing, the block-buffered device existed originally because it was the mechanism that the system used to cache filesystem data. In 4.4BSD this is no longer the way it works (caching is file based), so its original purpose of existing is gone now. Second, support for device based caching causes a lot of internal problems with buffer aliasing/cache coherency whenever someone opens the device and starts using it when the underlying filesystem is also mounted. Third, since writes to buffered devices are asynchronous, there is no way to know when/if you get an I/O error (e.g. floppies or other removable media), so the most common use of the device is much better served by using the character device. The general feeling of both myself and Kirk McKusick is that the blocking/buffering should be done at the application level and not by the kernel and that the block/buffered device should go away. -DG ----------------------------- PHK has been moving steadily in this direction to remove as many dependencies within the kernel on block devices as possible. The question is, When did the decision to do so become official? I don't believe it has been a stated official decision yet and so in order to put some clarity into the air over this I'd like to launch a PURELY TECHNICAL discussion on the topic. Here are some starters. 1/ block device writes have to be synchrnous or the user doesn't get write errors. 1A/ if they are not synchronous, errors need to be coped with in some other manner. 2/ People with old UNIX experience expect to be able to do unalligned transfers on block devices. 3/ DEVFS can cope just fine with block and char devices (I include this because DEVFS has been used as an argument for removing them) 4/ Most of the block buffering code in the kernel will remain due to the VM and VFS systems. 5/ New users don't tend to understand the rather strange distinctions between BLK and CHR devices. Some people consider having both POLA and others consider having only one POLA. Linux had til just recently, only BLK disk devices. They just aded CHR disk devices but I don't know if they created a whole second calss of device to do so. (I doubt it) 6/ It should be possible to make an overlay device (similar to the way ccd works), that supplies buffered characteristics to a disk. This may be a different minor number or a differnt major number.. but be a CHR type device. I'd like ot hear soem real thoughts and reasons here.. We need an official position on this or things will just get nasty. julian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.9910081840300.8009-100000>