On Sun, 2008-11-16 at 23:33 +0100, Andi Kleen wrote: > On Sun, Nov 16, 2008 at 11:56:21AM -0500, James Bottomley wrote: > > > v2: use dma api for all allocations > > > > Just a minute: this is another driver where you allocate coherent > > memory for the host structure but fail to use it for I/O as far as I can > > tell. > > > > What's going on here? If this is just a ploy to get GFP_DMA memory, > > then this isn't the way to do it. Firstly, it doesn't seem to be needed > > It's just that the structure was in GFP_DMA before due to unchecked_isa_dma > so I wanted to do a equivalent convertion > > > and secondly, coherent memory is hard (or impossible) to manufacture on > > certain platforms. You should only use it for DMA mailboxes and other > > register exchanges between the device and main memory ... expanding its > > use is asking for resource exhaustion. > > It's not expanding it, in fact it lowers it because they allocate > less in GFP_DMA now than with unchecked_isa_dma (e.g. no more commands > and sense buffers) but dma_alloc_coherent() isn't equivalent to an allocator with the dma_mask on most platforms. It is on x86 because that platform is fully coherent, but on most others it's taking memory from a special coherent pool. This is the resource which can exhaust easily. James -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html