On Fri, 24 Jun 2005 17:54:06 +1200, Xiangfei Jia wrote
> So, buddy allocator is used to solve external fragmentation. But itself has internal fragmentation problem. Slab allocator is built on top of buddy allocator, and solves the internal fragmentation caused by buddy allocator. Is my undersanding right? > > I'm reading the book you mentationed. That's where I got confused. I have read that part: there are two sets of caches, one for normal use, another one for DMA. What I can't understand is how the slab allocator overcome the internal fragmentation caused by buddy allocator. > > Thanks!!! > > Fei I think it solved internal fragmentation while you create a slab manager by kmem_cache_create(). It will check if the rest space of a slab cache is less than 1/8 itself after filling with objs, otherwise the creatation fails. Therefore, slab can make sure all your internal fragmentation does not exceed a certain range. Roach
|