Modified buddy system memory allocation
AssigneeHewlett-Packard Development Company, L.P.
InventorPrashanth Madisetti
Life of this patent
Estimating the term…
Abstract
A modified buddy system memory allocator of an apparatus in an example receives a request for a size of memory. The modified buddy system memory allocator identifies a plurality of contiguous, differently-sized memory blocks that are each smaller than the size of memory from the request. The modified buddy system memory allocator allocates the plurality of contiguous, differently-sized memory blocks to satisfy the request for the size of memory.
Claims18
An apparatus, comprising:
- a modified buddy system memory allocator configured to receive a request for a size of memory;
- wherein the modified buddy system memory allocator is configured to identify a plurality of contiguous, differently-sized memory blocks that are each smaller than the size of memory from the request;
- wherein the modified buddy system memory allocator is configured to allocate the plurality of contiguous, differently-sized memory blocks to satisfy the request for the size of memory,
- wherein a first free block list comprises one or more memory blocks that are of a first size, wherein a second free block list comprises one or more memory blocks that are of a second size different than the first size;
- wherein the plurality of contiguous, differently-sized memory blocks comprise a first memory block of the one or more memory blocks that are of the first size, wherein the plurality of contiguous, differently-sized memory blocks comprise a second memory block of the one or more memory blocks that are of the second size;
- wherein the modified buddy system memory allocator is configured to remove the first memory block from the first free block list and the second memory block from the second free block list to allocate the plurality of contiguous, differently-sized memory blocks to an application that made the request for the size of memory,
- wherein upon release of the plurality of contiguous, differently-sized memory blocks by the application, the modified buddy system memory allocator is to add the first memory block back into the first free block list and the second memory block back into the second free block list.
An apparatus, comprising:
- a storage to store free block lists of respective different sizes of free memory blocks;
- and
- a modified buddy system memory allocator configured to receive a request for a size of memory;
- wherein the modified buddy system memory allocator is configured to, in response to determining that a memory block larger than or equal in size to the size of memory from the request is unavailable, identify a plurality of contiguous, differently-sized memory blocks from the free block lists, wherein the plurality of contiguous, differently-sized memory blocks each has a size smaller than the size of memory from the request;
- wherein the modified buddy system memory allocator is configured to allocate the plurality of contiguous, differently-sized memory blocks to satisfy the request for the size of memory,
- wherein the plurality of contiguous, differently-sized memory blocks have not been coalesced into a single memory block when the modified buddy system memory allocator allocates the plurality of contiguous, differently-sized memory blocks to satisfy the request for the size of memory.
A method, comprising the steps of:
- storing, in a storage, a plurality of buddy system memory allocation free block lists of respective different sizes of free memory blocks;
- receiving, by a computer, a request for allocation of a size of memory;
- determining, from one of the plurality of free block lists by the computer, whether a memory block having a size larger than or equal to the size of the memory from the request is available;
- if the memory block having the size larger than or equal to the size of the memory from the request is unavailable;
- identifying, by the computer, a plurality of contiguous, differently-sized memory blocks that are each smaller than the size of memory from the request, wherein the plurality of contiguous, differently-sized memory blocks are associated with at least two of the plurality of buddy system memory allocation free block lists;
- and
- allocating, by the computer, the plurality of contiguous, differently-sized memory blocks to satisfy the request for the size of memory,
- wherein the step of allocating comprises the step of:
- allocating the plurality of contiguous, differently-sized memory blocks to satisfy the request without coalescing the plurality of contiguous, differently-sized memory blocks into a single memory block.
An apparatus, comprising:
- a storage to store free block lists of respective different sizes of free memory blocks;
- and
- a modified buddy system memory allocator configured to receive a request for a size of memory;
- wherein the modified buddy system memory allocator is configured to, in response to determining that a memory block larger than or equal in size to the size of memory from the request is unavailable, identify a plurality of contiguous, differently-sized memory blocks from the free block lists, wherein the plurality of contiguous, differently-sized memory blocks each has a size smaller than the size of memory from the request;
- wherein the modified buddy system memory allocator is configured to allocate the plurality of contiguous, differently-sized memory blocks to satisfy the request for the size of memory,
- wherein the modified buddy system memory allocator is configured to:
- identify a first of the plurality of contiguous, differently-sized memory blocks from a first of the free block lists;
- determine whether a second of the free block lists has a free memory block that starts at an address that is contiguous with an end of the first of the plurality of contiguous, differently-sized memory blocks;
- and
- if the second free block list has the free memory block, use the free memory block of the second free block list as a second of the plurality of contiguous, differently-sized memory blocks.
A method, comprising the steps of:
- receiving, by a computer, a request for allocation of a size of memory;
- identifying, by the computer, a plurality of contiguous, differently-sized memory blocks that are each smaller than the size of memory from the request, wherein the plurality of contiguous, differently-sized memory blocks are organized in a plurality of different buddy system memory allocation free block lists;
- and
- allocating, by the computer, the plurality of contiguous, differently-sized memory blocks to satisfy the request for the size of memory;
- wherein a first free block list comprises one or more free memory blocks that are of a first size, wherein a second free block list comprises one or more free memory blocks that are of a second size different than the first size;
- wherein the plurality of contiguous, differently-sized memory blocks comprise a first memory block of the one or more free memory blocks that are of the first size, wherein the plurality of contiguous, differently-sized memory blocks comprise a second memory block of the one or more free memory blocks that are of the second size;
- wherein the first memory block is removed from the first free block list and the second memory block is removed from the second free block list to allocate the plurality of contiguous, differently-sized memory blocks to an application that made the request for the size of memory;
- wherein upon release of the plurality of contiguous, differently-sized memory blocks by the application, the first memory block is added back into the first free block list and the second memory block is added back into the second free block list.
A method, comprising the steps of:
- storing, in a storage, a plurality of buddy system memory allocation free block lists of respective different sizes of free memory blocks;
- receiving, by a computer, a request for allocation of a size of memory;
- determining, from one of the plurality of free block lists by the computer, whether a memory block having a size larger than or equal to the size of the memory from the request is available;
- if the memory block having the size larger than or equal to the size of the memory from the request is unavailable;
- identifying, by the computer, a plurality of contiguous, differently-sized memory blocks that are each smaller than the size of memory from the request, wherein the plurality of contiguous, differently-sized memory blocks are associated with at least two of the plurality of buddy system memory allocation free block lists;
- and
- allocating, by the computer, the plurality of contiguous, differently-sized memory blocks to satisfy the request for the size of memory,
- wherein identifying the plurality of contiguous, differently-sized memory blocks comprises:
- identifying a first of the plurality of contiguous, differently-sized memory blocks from a first of the buddy system memory allocation free block lists;
- determining whether a second of the buddy system memory allocation free block lists has a free memory block that starts at an address that is contiguous with an end of the first of the plurality of contiguous, differently-sized memory blocks;
- and
- if the second buddy system memory allocation free block list has a free memory block, using the free memory block of the second buddy system memory allocation free block list as a second of the plurality of contiguous, differently-sized memory blocks.
Dependencies are inferred from the claim text.