Re: [PATCH] IP fragment SLAB

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

 



> But kmalloc() calls kmem_cache_alloc() in turn. So whether
> you call kmalloc or kmem_cache_alloc it is getting allocated
> from slab cache.  Am I missing something here?

> Regards,
>    Mala

Yyou might avoid the loop kmalloc does to hunt
for  the right size..

void * kmalloc (size_t size, int flags)
{
        cache_sizes_t *csizep = cache_sizes;

        for (; csizep->cs_size; csizep++) {
                if (size > csizep->cs_size)
                        continue;
                return __kmem_cache_alloc(flags & GFP_DMA ?
                         csizep->cs_dmacachep : csizep->cs_cachep, flags);
        }
        return NULL;
}


thanks,
Nivedita

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux