[381] in linux-scsi channel archive

home help back first fref pref prev next nref lref last post

Re: Reading more than buffersize

daemon@ATHENA.MIT.EDU (Drew Eckhardt)
Sun Jul 16 02:48:17 1995

To: eric@aib.com (Eric Youngdale)
cc: mucci@cs.utk.edu, linux-scsi@vger.rutgers.edu
In-reply-to: Your message of "Sat, 15 Jul 1995 23:01:00 EDT."
             <m0sXJxI-0009WNC@aib.com> 
Date: Sat, 15 Jul 1995 21:13:58 -0600
From: Drew Eckhardt <drew@poohsticks.org>

In message <m0sXJxI-0009WNC@aib.com>, eric@aib.com writes:
>
>>One difficult bit is maintaining synchronicity with the buffer 
>>cache in a way that's compatable with performance.  If you do a single 
>>direct read/write, it would probably be optimal to just set your pages 
>>to COW and give them a context in the buffer cache as wll. 
>
>	Hmm, I was thinking in terms of only a character device.  

I'm thinking in a much more general sense - character devices first,
since they're relatively easy to implement and test.  Later, a 
flag like O_SYNC (which could be made the default as a per-process
peronality option).

Character devices are useful for a very limited subset of applications - 
with the big one being databases that do their own "filesystem" on top 
of the raw device.

>The normal block devices already effectively do it with 0 copies (provided
>that bounce buffers are not required), since we perform DMA directly into
>the buffer cache.  The problem is that if the user wants to read a file,
>we have one copy out of the buffer cache into the user's buffer.  

Bingo.  Also, even when we don't care about the data after it's used, we've
incurred the overhead of the buffer cache code, and perhaps flushed data 
that we will care about more than once (ie, directory structures).

>	Are you thinking of a way of reading into the buffer cache
>without copying into the user's buffer that would be compatible with
>mmap?

A combination of 
	- Reading directly into the users buffer through the filesystem code,
	    and not worring about the buffer cache
	- Reading directly into the user's buffer, and having this data appear
	    in both the buffer cache and user space with no copies.

depending on which is more appropriate for a given situation.  
    

home help back first fref pref prev next nref lref last post