tech-net archive

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

RFC: m_tag pool cache



Hi,

Currently, m_tag_get() calls malloc()(kern_malloc()), and then
kern_malloc() calls pool_cache_get() as long as m_tag size is not too
large.

According to my measurements of using DTrace, there is a certain
overhead between kern_malloc() and pool_cache_get(). Here is each
function's average turnaround times in my measurement.

    m_tag_get            | 124205 [ns]
    kern_malloc          | 108007 [ns]
    kmem_intr_alloc      |  89636 [ns]
    pool_cache_get_paddr |  65942 [ns]

i.e. the overhead between kern_malloc() and pool_cache_get() is 42065[ns],
this overhead is considerable compared to pool_cache_get_paddr()'s
turnaround time.

Of course, m_tag_get() is used by packet processing path, this overhead
would have a certain influence on packet throughput and latency.
So, I think m_tag should use a dedicated pool cache like mbuf to call
pool_cache_get() directly.

Here is the patch to introduce mbuf pool cache.
    http://www.netbsd.org/~knakahara/mtag-pool-cache/mtag-pool-cache.patch

Could you comment this patch? Any comments are welcome.


Thanks,

-- 
//////////////////////////////////////////////////////////////////////
Internet Initiative Japan Inc.

Device Engineering Section,
Core Product Development Department,
Product Division,
Technology Unit

Kengo NAKAHARA <k-nakahara%iij.ad.jp@localhost>


Home | Main Index | Thread Index | Old Index