Subject: Re: umass buffers (Was: Re: Nikon D70)
To: Jukka Marin <jmarin@embedtronics.fi>
From: Lennart Augustsson <lennart@augustsson.net>
List: netbsd-users
Date: 07/22/2004 09:54:58
Jukka Marin wrote:
> Hi,
> 
> Is it possible to do the following as a workaround for the "umass0: no
> buffer memory" problem:
> 
> - Allocate a pool of umass buffers (64k each) at boot time (kind of "mbufs")
> - When a umass device is plugged in, a buffer is allocated from the pool
> - When a umass device is disconnected, the buffer is deallocated back to
>   the pool
> 
> The number of buffers could be configurable using a kernel option.  Without
> this option, the code would work the same way it "works" now.
> 
> I don't think allocating 64k or even 256k for umass buffers would be a
> problem on current machines.  At least it would let us use umass devices
> without reboots or other kludges :-I

Yes, that could be used as a temporary hack until the real
problem is solved.  There are really two real problems.

First, the USB host controller drivers could with some work
be made to handle non-contigous buffers.  This should indeed
be fixed.

Second, I don't understand why the kernel should be unable
to allocate contigous memory.  Even if all pages are in use
it should be possible to clean and free some pages to satisfy
the allocation request.

	-- Lennart