Re: allocation failed: out of vmalloc space error treating and VIDEO1394 IOC LISTEN CHANNEL ioctl failed problem

From: David Moore
Date: Mon Jan 15 2007 - 15:08:52 EST


On Mon, 2007-01-15 at 10:20 -0800, Arjan van de Ven wrote:
> if you need that much you probably should redesign your algorithms to
> not need vmalloc in the first place....

I think you've convinced me that vmalloc is not a good choice when a
driver needs a large buffer (many megabytes) for DMA.

In this case, we need a large ring buffer for reception of isochronous
packets from a firewire device. If I understand you correctly, you are
suggesting that this buffer be obtained as followed:

1. Application performs malloc() in user-space and mmap()s it.
2. Driver uses vmalloc_to_page() on every page of the malloc'ed memory
and constructs a scatter-gather list.
3. Map the sg list with pci_map_sg().
4. Commence DMA.

Is that correct? In particular, does it do the right thing in terms of
pinning the memory and dealing with high memory?

I notice that the block I/O API has some convenience functions for this,
but this is not a block device. Are there some other convenience
functions that can be used?

Forgive me if these are obvious questions -- I'm not the developer of
video1394, but I'd still like get it right for the new firewire stack
that's being developed.

Thanks,

David

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/