Subject: Re: SCSI questions
To: <>
From: Michael L. VanLoon -- Iowa State University <>
List: current-users
Date: 05/16/1994 14:58:25
>>Well, the stubs are there, the code has just never been written to do
>> the actual dance.  There is a performance hit for doing it this way,
>> however, since you're doing a lot more copying for each disk transfer.
>> An EISA board will just plain be faster in this scenario.
>> I know it isn't a high priority -- any idea on when bounce buffers
>> might make the list?
>> 				--Michael

>Wouldn't it be easier to write an allocator that just returns memory within
>the first 16M...the DMA bufs already have to be contiguous and locked in
> it couldn't be too hard to look for a mem chunk in the first 16M
>and failing that reclaim pages until it did?
>You already have to have some way to get memory in the first 16M anyway
>so the first buffer of the bounce works, why not just make sure that the
>inital allocation gets the buffer that will work all the way through?

I'm not exactly sure what you're asking.  If the memory allocator only
gave memory below 16M, any extra memory you had would be worthless.
It really wouldn't be useful to only allocate certain buffers below
16M because they aren't the only thing that gets direcly accessed.

For instance, I believe the I/O code likes to transfer directly
to/from user memory if possible when doing block transfers, and the
kernel has no way of knowing at allocation time if a variable being
allocated on the stack is going to be used only internally, or is
going to end up as a block of memory used for buffered I/O.  Also,
what about paging?  When the kernel elects a page to get swapped out,
it DMA's that page directly to the disk device if possible.  So, any
allocated pages above 16M would either have to be bounced lower, or
not paged out at all.

NetBSD already allocates its buffers in very low memory.  But they
aren't the only things DMA touches in normal operation.

Understand that these are just my understanding of the situation, and
I very well could be missing something.

>This asked by a total non-expert in the details of the whole thing...

Don't worry -- I'm decidedly a non-expert myself. :-)  I've just been
hanging around here for a very long time.


 Michael L. VanLoon                 Iowa State University Computation Center                    Project Vincent Systems Staff
  Free your mind and your machine -- NetBSD free Un*x for PC/Mac/Amiga/etc.