A slab is a collection of objects of the same size. This avoids fragmentation by allocating a fairly large block of memory and dividing it into parts of equal size. The number of pieces is usually much more than two, say 128 or so.
There are two ways to use stoves. First, you can only have a slab for one size, which you select very often. For example, the kernel may have an inode panel. But you can also have several progressive-sized slabs, such as a 128-byte slab, a 192-byte slab, a 256-byte slab, and so on. Then you can select an object of any size from the next plate size up.
Note that in any case, slab does not reuse memory for objects of different sizes, unless the entire slab is freed back to the global allocator of large blocks.
The buddy system is an unrelated method in which each object has a buddy object with which it merges when it is freed. Blocks are split in half when smaller blocks are required. Please note that in the buddy system, blocks are divided and combined into larger blocks as the main means of distribution and return for reuse. This is very different from how plates work.
Or easier:
Friends system: blocks of different sizes are divided during distribution and combined at release to effectively divide a large block into smaller blocks of different sizes as needed.
Slab: very large blocks are distributed and divided once into blocks of equal size. No other division or coalescence occurs, and the freed blocks are simply stored in a list that should be assigned for subsequent distributions.
The Linux kernel kernel is a flexible distributed system distributor. This dispenser provides slabs for a variety of poster slabs.
source share