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:
“This seems to be advanced as the surest basis for our belief in the existence of gods, that there is no race so uncivilized, no one in the world so barbarous that his mind has no inkling of a belief in gods.”
—Marcus Tullius Cicero (10643 B.C.)
“That food has always been, and will continue to be, the basis for one of our greater snobbisms does not explain the fact that the attitude toward the food choice of others is becoming more and more heatedly exclusive until it may well turn into one of those forms of bigotry against which gallant little committees are constantly planning campaigns in the cause of justice and decency.”
—Cornelia Otis Skinner (19011979)
“The Love that dare not speak its name in this century is such a great affection of an elder for a younger man as there was between David and Jonathan, such as Plato made the very basis of his philosophy, and such as you find in the sonnets of Michelangelo and Shakespeare. It is that deep, spiritual affection that is as pure as it is perfect.... It is in this century misunderstood ... and on account of it I am placed where I am now.”
—Oscar Wilde (18541900)