Slab Allocation - Basis

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:

    Knighterrantry is a most chuckleheaded trade, and it is tedious hard work, too, but I begin to see that there is money in it, after all, if you have luck. Not that I would ever engage in it, as a business, for I wouldn’t. No sound and legitimate business can be established on a basis of speculation. A successful whirl in the knighterrantry line—now what is it when you blow away the nonsense and come down to the cold facts? It’s just a corner in pork, that’s all.
    Mark Twain [Samuel Langhorne Clemens] (1835–1910)

    The basis on which good repute in any highly organized industrial community ultimately rests is pecuniary strength; and the means of showing pecuniary strength, and so of gaining or retaining a good name, are leisure and a conspicuous consumption of goods.
    Thorstein Veblen (1857–1929)

    It was the custom
    For his rage against chaos
    To abate on the way to church,
    In regulations of his spirit.
    How good life is, on the basis of propriety,
    To be followed by a platter of capon!
    Wallace Stevens (1879–1955)