Subject: Re: USB reserve memory patch
To: Chapman Flack <flack@cerias.purdue.edu>
From: Frank van der Linden <fvdl@netbsd.org>
List: port-i386
Date: 10/12/2004 17:59:35
On Tue, Oct 12, 2004 at 09:06:03AM -0500, Chapman Flack wrote:
> So, here's a question. When the problem occurs (pre-patch), is it because
> 1) the usb_mem manager has fragmented its own pool of dinky blocks that it
> manages on top of what it allocates from bus_dmamem_alloc(), OR
> 2) usb_allocmem has made a call for a fresh allocation from bus_dmamem_alloc
> that has failed because _the system_ can't supply the requested memory
> contiguously?
Yes, it's 2).
It's actually not BUS_MEM_RESERVE at this point, but USB_MEM_RESERVE. It
is a chunk of bus_dmamem_alloc'ed memory (and hence contiguous memory)
that is allocated per USB host interface.
A mechanism like this can be extended to be generic for all hotplug
bus attachments, but I didn't want to go there; I think it may be
worth it to look at UVM for a patch first, it would be cleaner. My
patch is a USB-only workaround, though it can easily be applied
to cardbus.
- Frank