kva size on amd64
Andriy Gapon
avg at FreeBSD.org
Sun Feb 3 10:04:48 UTC 2013
on 02/02/2013 20:34 Alan Cox said the following:
> On 02/01/2013 03:47, Andriy Gapon wrote:
>> Actually, I have been obsessed quite for some time with an idea of confining ZFS
>> to its own submap. But ZFS does its allocations through malloc(9) and uma(9)
>> (depending on configuration). It seemed like a bit of work to provide support
>> for per-zone or per-tag submaps in uma and malloc.
>> What is your opinion of this approach?
>
> I'm skeptical that it would accomplish anything. Specifically, I don't
> think that it would have any impact on the fragmentation problem that we
> have with ZFS. On amd64, with its direct map, all small allocations are
> implemented by uma_small_alloc() and accessed through the direct map,
> rather than coming from the kmem map. Outside of ZFS, large, multipage
> allocations from the kmem map aren't that common. So, for all practical
> purposes, ZFS has the kmem map to itself.
I agree.
My line of thinking was this. Allocate smaller kmem_map bu default (e.g. 1/3 of
memory as it was before). If ZFS is not used, then that's it.
If ZFS is used then it allocated an additional submap out of kernel_map. The
submap would be sized based on configured or autoconfigured maximum size of ARC,
e.g. 1.5 * arc_max_size. But that's probably more wasteful than needed for
those who use ZFS.
> While I'm here, I'll offer some other food for thought. In HEAD, we
> have a new-ish function, vm_page_alloc_contig(), that can allocate
> contiguous, unmapped physical pages either to an arbitrary vm object or
> VM_ALLOC_NOOBJ, just like vm_page_alloc(). Moreover, just like
> vm_page_alloc(), it honors the VM_ALLOC_{NORMAL,SYSTEM,INTERRUPT}
> thresholds and wakes the page daemon when appropriate.
>
> Using this function, you could rewrite the multipage allocation code to
> first attempt allocation through vm_page_alloc_contig() and then fall
> back to the kmem map only if vm_page_alloc_contig() fails.
This is a very interesting idea for systems with direct map!
P.S.
I hope I don't get an indigestion with all the food :-)
--
Andriy Gapon
More information about the freebsd-arch
mailing list