From: Gareth H. <ga...@va...> - 2001-03-13 17:32:39
|
Keith Whitwell wrote: > > But of course, we should never be getting rid of or aquiring new dma buffers; > we should be just aging regions within a buffer we always hold, and perhaps in > rare cases growing/shrinking it. > > However, mprotect doesn't help you here either, as the regions being aged are > pretty dynamic. If only I could sit down and finish my dynamic heap code... :-) My plan is to basically have a pool of 2-4 MB DMA regions, with each one assigned to at most one context. The context handles all allocation within the buffer, and the regions are aged by the kernel when they are flushed. The flush is the only thing that you need to go into the kernel for, and I can't really see any way around that. (Note: current status is working allocation code in a single region, need to finish off multiple regions, switching regions between contexts and the like. The new SAREA code will allow a finer grain of control over the region, as we're currently limited to a 4K control page). If you were lucky enough to fill your region, your next LOCK_DMA_REGION() would automagically grab you another one. I think that's easier than trying to resize the current one. Grabbing another region may result in allocating and binding more AGP memory, but that's a nice and transparent side effect. -- Gareth |