Basis
The primary motivation for slab allocation is that the initialization and destruction of kernel data objects can actually outweigh the cost of allocating memory for them. As object creation and deletion are widely employed by the kernel, mitigating overhead costs of initialization can result in significant performance gains. The notion of object caching was therefore introduced in order to avoid the invocation of functions used to initialize object state.
With slab allocation, memory chunks suitable to fit data objects of certain type or size are preallocated. The slab allocator keeps track of these chunks, known as caches, so that when a request to allocate memory for a data object of a certain type is received it can instantly satisfy the request with an already allocated slot. Destruction of the object, however, does not free up the memory, but only opens a slot which is put in the list of free slots by the slab allocator. The next call to allocate memory of the same size will return the now unused memory slot. This process eliminates the need to search for suitable memory space and greatly alleviates memory fragmentation. In this context a slab is one or more contiguous pages in the memory containing pre-allocated memory chunks.
Read more about this topic: Slab Allocation
Famous quotes containing the word basis:
“Reason looks at necessity as the basis of the world; reason is able to turn chance in your favor and use it. Only by having reason remain strong and unshakable can we be called a god of the earth.”
—Johann Wolfgang Von Goethe (17491832)
“Our fathers and grandfathers who poured over the Midwest were self-reliant, rugged, God-fearing people of indomitable courage.... They asked only for freedom of opportunity and equal chance. In these conceptions lies the real basis of American democracy. They and their fathers give a genius to American institutions that distinguished our people from any other in the world.”
—Herbert Hoover (18741964)
“My dream is that as the years go by and the world knows more and more of America, it ... will turn to America for those moral inspirations that lie at the basis of all freedom ... that America will come into the full light of the day when all shall know that she puts human rights above all other rights, and that her flag is the flag not only of America but of humanity.”
—Woodrow Wilson (18561924)