Re: Slab allocator - questions

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

 



On Thu, Apr 04, 2002 at 08:19:08AM +0200, Martin Maletinsky wrote:
> Thank you for your reply. Could you detail how memory fragmentation is 
> reduced? I understand the assumption that objects of the same type (and 
> therefore same size) tend to have similar lifetimes. However the general 
> caches for objects that are a multiple of a page size contain one object 
> per cache (see /proc/slabinfo). Each time such an object is allocated by 
> kmalloc(), the slab allocator will therefore use a new slab (which is 
> allocated by calling into the buddy system). So what is the difference 
> with > respect to memory fragmentation compared to calling straight the 
> buddy system by using get_free_pages()?

You're making assumptions about the page size of the system.  True, on 
most platforms it will result in the same effect as directly hitting the 
page allocator, but that is not always the case.  Think of ia64 with 
large page sizes (64KB and 256KB are supported by the hardware iirc).  In 
that case the slab will have an effect.

That said, the main reason for having the large slabs is backwards 
compatibility with kmalloc.

		-ben
-- 
"A man with a bass just walked in,
 and he's putting it down
 on the floor."
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux