Hi Zach, >Zach Pfeffer <zpfeffer@xxxxxxxxxxxxxx> wrote: >On Tue, Jul 20, 2010 at 05:51:25PM +0200, Michal Nazarewicz wrote: (snip) >> +* Contiguous Memory Allocator >> + >> + The Contiguous Memory Allocator (CMA) is a framework, which allows >> + setting up a machine-specific configuration for physically-contiguous >> + memory management. Memory for devices is then allocated according >> + to that configuration. >> + >> + The main role of the framework is not to allocate memory, but to >> + parse and manage memory configurations, as well as to act as an >> + in-between between device drivers and pluggable allocators. It is >> + thus not tied to any memory allocation method or strategy. >> + > >This topic seems very hot lately. I recently sent out a few RFCs that >implement something called a Virtual Contiguous Memory Manager that >does what this patch does, and works for IOMMU and works for CPU >mappings. It also does multihomed memory targeting (use physical set 1 >memory for A allocations and use physical memory set 2 for B >allocations). Check out: > >mm: iommu: An API to unify IOMMU, CPU and device memory management >mm: iommu: A physical allocator for the VCMM >mm: iommu: The Virtual Contiguous Memory Manager > >It unifies IOMMU and physical mappings by creating a one-to-one >software IOMMU for all devices that map memory physically. > >It looks like you've got some good ideas though. Perhaps we can >leverage each other's work. Yes, I have read your RFCs when they originally come out and I think that CMA could be used as a physical memory allocator for VCMM, if such a need arises. Of course this would only make sense in special cases. One idea I have is that this could be useful if we wanted to have a common kernel for devices with and without an IOMMU. This way the same virtual address spaces could be set up on top of different allocators for different systems and use discontiguous memory for SoCs with an IOMMU and contiguous for SoCs without it. What do you think? I am aware that you have your own physical memory allocator, but from what you wrote, you use pools of contiguous memory consisting of indivisible, fixed-size blocks (which is of course a good idea in the presence of an IOMMU). Moreover, those advanced region traits and sharing specification features of CMA are a must for us. I don't perceive VCMM and CMA as competing solutions for the same problem, they solve different problems and I believe could not only coexist, but be used together in specific use cases. Best regards -- Pawel Osciak Linux Platform Group Samsung Poland R&D Center -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxxx For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>