tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Patch: optimize kmem_alloc for frequent mid-sized allocations



Andrew Doran <ad%NetBSD.org@localhost> writes:

> How about KASSERT(pa->pa_pagesz == sz) when the cache is being set up?
> Looking at vmem, for its quantum caches it seems to allocate larger
> pool pages, qcache_max*3. I guess this is to avoid excessive
> fragmentation.
> 
>       http://nxr.netbsd.org/source/xref/sys/kern/subr_vmem.c#435

Hm, is the following check in pool_init() insufficient?

#ifdef DIAGNOSTIC
        if (size > palloc->pa_pagesz)
                panic("pool_init: pool item size (%zu) too large", size);
#endif  

Or is there reason to enforce pa_pagesz == sz if PR_NOPOOL is set, or
reason not to rely on the check in pool_init() (such as since we're
skipping the layer)?

enami.


Home | Main Index | Thread Index | Old Index