Hi, I further investigated the interaction between vmem and kmem which seems a bit wired to me. At the vmem layer we do have the small allocation quantum caching sizes while we do have the larger sized caches at the kmem layer and the vmem arena is used as the backing for the kmem layer..... This situation will cause fragmentation in the arena and is like an upside down situation. The quantum caching in the vmem should be for multiples of the allocation size that the kmem does from it. As for proper scalability the caching is important, but we do have this at the pool-layer and prober va allocation is required from kernel_map and kmem_map, which is realized by the maps va_caches for small size and could be enhanced for large allocation as well I suggest to base kmem directly on the uvm_km. With all kmem allocation going to kmem, which in turn would make it possible to give it a small wrapper layer to replace malloc. And to rework the vmem to replace extent (probably without quantum caches or are they needed anywhere else? I didn't find any use beyond the one mentioned above) This would retire the old malloc and extent subsystems.
Lars -- Mystische Erklärungen: Die mystischen Erklärungen gelten für tief; die Wahrheit ist, dass sie noch nicht einmal oberflächlich sind. -- Friedrich Nietzsche [ Die Fröhliche Wissenschaft Buch 3, 126 ]