Re: proposed change for async vbuffer heads

Bernd Paysan (paysan@informatik.tu-muenchen.de)
Mon, 25 Aug 1997 00:48:53 +0200


Linus Torvalds wrote:
> Oh, I'd _love_ to get the buffer cache issues cleaned up.
[...]
> page = __get_free_page();
> create_buffer_heads(page);
> do_io(page);
> copy/map_to_user()
> free_page(page);

All these things would be much easier, if block based I/O would work by
mapping the I/O device into memory. This isn't possible for 32 bit
machines, because hard disks are bigger than virtual memory size, but at
the moment it's possible for 64 bit machines. So Linux needs the buffer
heads to do the translation device space <-> memory, but for nothing
more. On Linux/Alpha, create_buffer_head could be a nop, and do_io could
just map the buffer page into the block device I/O area. Copying would
do the real I/O, as do user accesses on pages mapped to user. The same
code that handles prefetches in memory mapped files can handle
prefetches on block device I/O. In fact, mapping a file from a file
system (if it's written on page boundaries) would only remap the block
device memory, so there's no difference between raw I/O and file system
I/O, if the file is unfragmented and written on page boundaries.

-- 
Bernd Paysan
"Late answers are wrong answers!"
http://www.informatik.tu-muenchen.de/~paysan/