IP Library Granted Patent US 10,209,900
Granted Patent B2
US 10,209,900 · App. 15/347,547 · Granted Feb 19, 2019

Buffer allocation and memory management using mapping table

Inventors: Deepak Goel (San Jose, CA); Wael Noureddine (Santa Clara, CA); Paul Kim (Fremont, CA)
Assignee: Fungible, Inc.
G06F3/0613G06F3/0656G06F3/0673
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,209,900
App. No.
15/347,547
Granted
Feb 19, 2019
Kind
B2
Abstract

Methods and apparatus for buffer allocation and memory management are described. A plurality of buffers of a memory may be allocated, by a memory controller, with the buffers having variable sizes. The memory controller may maintain a mapping table that associates each of a plurality of access keys to a respective one of a plurality of page addresses of a plurality of pages of the memory. Each of the buffers may respectively include one or more contiguous pages of the plurality of pages of the memory. Each page of the plurality of pages may include one or more blocks of the memory. The mapping table may include one or more entries organized in a tree structure.

Claims (126)

1. A method of buffer allocation and memory management, comprising:

allocating, by a memory controller, a plurality of buffers of a memory with the buffers having variable sizes, wherein each of the buffers comprises one or more pages that are contiguous within a physical buffer space of the respective one of the buffers, wherein each of the pages comprises one or more blocks for data storage, and wherein the one or more pages within the physical buffer space correspond to one or more page addresses of a plurality of page addresses within a physical memory space of the memory;

maintaining, by the memory controller, a mapping table that includes one or more entries organized in a tree structure, wherein each of the entries associates one of a plurality of access keys for the buffers to a respective one of the plurality of page addresses within the physical memory space of the memory, wherein each of the plurality of access keys comprises a unique buffer handle that indicates a buffer of the plurality of buffers and a page number of one of the pages within the physical buffer space of the buffer;

receiving, by the memory controller and from a processing core, a command to access the buffer of the plurality of buffers, wherein the command includes the unique buffer handle that indicates the buffer and the page number of one of the pages within the physical buffer space of the buffer;

determining, by the memory controller and based on the mapping table, a page address within the physical memory space of the memory using an access key comprising the unique buffer handle and the page number included in the command; and

performing, by the memory controller, the command using the page address within the physical memory space of the memory.

2. The method of claim 1 , wherein the maintaining of the mapping table comprises:

assigning the unique buffer handle to the buffer of the plurality of buffers; and

creating a one-level tree structure, as the tree structure of the mapping table, to accommodate a single page within the physical buffer space of the buffer,

wherein the unique buffer handle serves as a physical address of the single page within the physical buffer space of the buffer.

3. The method of claim 2 , further comprising:

initializing the unique buffer handle of the buffer with configuration indicating whether the buffer is expandable,

wherein, in an event that the buffer is non-expandable, the configuration further indicates a maximum size of the buffer.

4. The method of claim 2 , further comprising:

expanding the one-level tree structure of the mapping table into a two-level tree structure to accommodate a first number of plural pages within the physical buffer space of the buffer,

wherein the expanding of the one-level tree structure into the two-level tree structure comprises:

creating a multi-page pointer at a top level of the tree structure to reference one or more single-page pointers at a bottom level of the tree structure; and

creating the one or more single-page pointers at the bottom level of the tree structure with each of the one or more single-page pointers referencing a respective page within the physical buffer space of the buffer.

5. The method of claim 4 , further comprising:

expanding the two-level tree structure of the mapping table into a multi-level tree structure to accommodate a second number of plural pages within the physical buffer space of the buffer,

wherein the second number is greater than the first number,

wherein the multi-page pointer comprises a first multi-page pointer, and

wherein the expanding of the two-level tree structure into the multi-level tree structure comprises:

creating a second multi-page pointer at the top level of the tree structure to reference one or more first multi-page pointers at a middle level of the tree structure;

creating the one or more first multi-page pointers at the middle level of the tree structure with each of the one or more first multi-page pointers referencing one or more single pointers of a plurality of single-page pointers at the bottom level of the tree structure; and

creating the plurality of single-page pointers at the bottom level of the tree structure with each of the plurality of single-page pointers referencing a respective page within the physical buffer space of the buffer.

6. The method of claim 1 , wherein the maintaining of the mapping table comprises:

assigning the unique buffer handle to the buffer of the plurality of buffers; and

creating a two-level tree structure, as the tree structure of the mapping table, to accommodate a first number of plural pages within the physical buffer space of the buffer,

wherein the unique buffer handle serves as a physical address of a first page of the plural pages within the physical buffer space of the buffer, and

wherein the creating of the two-level tree structure comprises:

creating a multi-page pointer at a top level of the tree structure to reference one or more single-page pointers at a bottom level of the tree structure; and

creating the one or more single-page pointers at the bottom level of the tree structure with each of the one or more single-page pointers referencing a respective page within the physical buffer space of the buffer.

7. The method of claim 6 , further comprising:

expanding the two-level tree structure of the mapping table into a three-level tree structure to accommodate a second number of plural pages within the physical buffer space of the buffer,

wherein the second number is greater than the first number,

wherein the multi-page pointer comprises a first multi-page pointer, and

wherein the expanding of the two-level tree structure into the three-level tree structure comprises:

creating a second multi-page pointer at the top level of the tree structure to reference one or more first multi-page pointers at a middle level of the tree structure;

creating the one or more first multi-page pointers at the middle level of the tree structure with each of the one or more first multi-page pointers referencing one or more single pointers of a plurality of single-page pointers at the bottom level of the tree structure; and

creating the plurality of single-page pointers at the bottom level of the tree structure with each of the plurality of single-page pointers referencing a respective page within the physical buffer space of the buffer.

8. The method of claim 1 , wherein the maintaining of the mapping table comprises:

assigning the unique buffer handle to the buffer of the plurality of buffers;

creating a two-level tree structure, as the tree structure of the mapping table, for a first page and a second page within the physical buffer space of the buffer; and

creating a page pointer that points from the first page to the second page,

wherein the unique buffer handle serves as a physical address of the first page within the physical buffer space of the buffer.

9. The method of claim 1 , wherein the allocating of the plurality of buffers of the memory comprises allocating each of the plurality of buffers of variable sizes in a constant time.

10. The method of claim 1 , wherein the allocating of the plurality of buffers of the memory comprises performing, for each buffer of the plurality of buffers, operations comprising:

assigning the unique buffer handle to the buffer;

allocating a page of the one or more pages included in the physical buffer space of the buffer to store data, with the allocated page corresponding to a respective page address of the plurality of page addresses within the physical memory space of the memory;

determining a page number of the allocated page, with the unique buffer handle of the buffer and the page number of the allocated page forming the respective access key for the buffer; and

creating a respective entry in the mapping table for the allocated page of the buffer, with the respective entry associating the respective page address within the physical memory space of the memory to the respective access key for the buffer.

11. The method of claim 1 ,

wherein receiving the command to access the buffer comprises receiving a write command to write data into one or more blocks of one or more pages of the buffer of the plurality of buffers;

wherein determining the page address comprises determining whether the mapping table includes an entry associating the access key for the buffer indicated in the write command to the page address within the physical memory space of the memory; and

wherein performing the command comprises, responsive to a determination that the mapping table includes the entry for the access key, writing the data into the page address within the physical memory space of the memory.

12. The method of claim 1 ,

wherein receiving the command to access the buffer comprises receiving a write command to write data into one or more blocks of one or more pages of the buffer of the plurality of buffers;

wherein determining the page address comprises:

determining whether the mapping table includes an entry associating the access key for the buffer indicated in the write command to the page address within the physical memory space of the memory;

responsive to a determination that the mapping table includes no entry for the access key, performing operations comprising:

identifying the unique buffer handle of the buffer of the plurality of buffers for storing the data for the write command;

allocating a page of the one or more pages that are contiguous within the physical buffer space of the buffer to store the data, with the allocated page corresponding to a respective page address of the plurality of page addresses within the physical memory space of the memory;

determining the page number of the allocated page, with the unique buffer handle of the buffer and the page number of the allocated page forming the respective access key of the plurality of access keys for the buffer;

creating a respective entry in the mapping table for the allocated page of the buffer, with the respective entry associating the respective page address within the physical memory space of the memory to the respective access key for the buffer; and

wherein performing the command comprises writing the data into the page address within the physical memory space of the memory.

13. The method of claim 1 , further comprising:

receiving a free page command to deallocate one or more pages of a buffer of the plurality of buffers;

determining whether a state of the buffer is valid;

responsive to a determination that the state of the buffer is valid, deallocating the buffer by performing operations comprising:

removing an entry in the mapping table associating an access key for the buffer indicated in the free page command to a page address within the physical memory space of the memory; and

incrementing a free page counter by a number of pages in the buffer.

14. The method of claim 1 , further comprising:

receiving a free page command to deallocate one or more pages of a buffer of the plurality of buffers;

determining whether a state of the buffer is valid; and

responsive to a determination that the state of the buffer is other than valid, suspending execution of the free page command.

15. The method of claim 1 ,

wherein receiving the command to access the buffer comprises receiving a read command to read data from one or more blocks of one or more pages of the buffer of the plurality of buffers;

wherein determining the page address comprises:

determining whether a state of the buffer is valid, and

responsive to a determination that the state of the buffer is valid, determining that the mapping table includes an entry associating the access key for the buffer indicated in the read command to the page address within the physical memory space of the memory; and

wherein performing the command comprises reading the data from the page address within the physical memory space of the memory.

16. An apparatus of buffer allocation and memory management, comprising:

one or more processing cores;

a memory; and

a memory controller communicatively coupled to the processing cores and the memory to control access to the memory, the memory controller configured to perform operations comprising:

allocating a plurality of buffers of the memory with the buffers having variable sizes, wherein each of the buffers comprises one or more pages that are contiguous within a physical buffer space of the respective one of the buffers, wherein each of the pages comprises one or more blocks for data storage, and wherein the one or more pages within the physical buffer space correspond to one or more page addresses of a plurality of page addresses within a physical memory space of the memory;

maintaining a mapping table that includes one or more entries organized in a tree structure, wherein each of the entries associates one of a plurality of access keys for the buffers to a respective one of the plurality of page addresses within the physical memory space of the memory, wherein each of the plurality of access keys comprises a unique buffer handle that indicates a buffer of the plurality of buffers and a page number of one of the pages within the physical buffer space of the buffer;

receiving, by the memory controller and from a processing core, a command to access the buffer of the plurality of buffers, wherein the command includes the unique buffer handle that indicates the buffer and the page number of one of the pages within the physical buffer space of the buffer;

determining, by the memory controller and based on the mapping table, a page address within the physical memory space of the memory using an access key comprising the unique buffer handle and the page number included in the command; and

performing, by the memory controller, the command using the page address within the physical memory space of the memory.

17. The apparatus of claim 16 , wherein, in maintaining the mapping table, the memory controller is configured to perform operations comprising:

assigning the unique buffer handle to the buffer of the plurality of buffers; and

creating a one-level tree structure, as the tree structure of the mapping table, to accommodate a single page within the physical buffer space of the buffer,

wherein the unique buffer handle serves as a physical address of the single page within the physical buffer space of the buffer.

18. The apparatus of claim 17 , wherein the memory controller is further configured to perform operations comprising:

initializing the unique buffer handle of the buffer with configuration indicating whether the buffer is expandable,

wherein, in an event that the buffer is non-expandable, the configuration further indicates a maximum size of the buffer.

19. The apparatus of claim 17 , wherein the memory controller is further configured to perform operations comprising:

expanding the one-level tree structure of the mapping table into a two-level tree structure to accommodate a first number of plural pages within the physical buffer space of the buffer,

wherein the expanding of the one-level tree structure into the two-level tree structure comprises:

creating a multi-page pointer at a top level of the tree structure to reference one or more single-page pointers at a bottom level of the tree structure; and

creating the one or more single-page pointers at the bottom level of the tree structure with each of the one or more single-page pointers referencing a respective page within the physical buffer space of the buffer.

20. The apparatus of claim 19 , wherein the memory controller is further configured to perform operations comprising:

expanding the two-level tree structure of the mapping table into a multi-level tree structure to accommodate a second number of plural pages within the physical buffer space of the buffer,

wherein the second number is greater than the first number,

wherein the multi-page pointer comprises a first multi-page pointer, and

wherein the expanding of the two-level tree structure into the multi-level tree structure comprises:

creating a second multi-page pointer at the top level of the tree structure to reference one or more first multi-page pointers at a middle level of the tree structure;

creating the one or more first multi-page pointers at the middle level of the tree structure with each of the one or more first multi-page pointers referencing one or more single pointers of a plurality of single-page pointers at the bottom level of the tree structure; and

creating the plurality of single-page pointers at the bottom level of the tree structure with each of the plurality of single-page pointers referencing a respective page within the physical buffer space of the buffer.

21. The apparatus of claim 16 , wherein, in maintaining the mapping table, the memory controller is configured to perform operations comprising:

assigning the unique buffer handle to the buffer of the plurality of buffers; and

creating a two-level tree structure, as the tree structure of the mapping table, to accommodate a first number of plural pages within the physical buffer space of the buffer,

wherein the unique buffer handle serves as a physical address of a first page of the plural pages within the physical buffer space of the buffer, and

wherein the creating of the two-level tree structure comprises:

creating a multi-page pointer at a top level of the tree structure to reference one or more single-page pointers at a bottom level of the tree structure; and

creating the one or more single-page pointers at the bottom level of the tree structure with each of the one or more single-page pointers referencing a respective page within the physical buffer space of the buffer.

22. The apparatus of claim 21 , wherein the memory controller is further configured to perform operations comprising:

expanding the two-level tree structure of the mapping table into a multi-level tree structure to accommodate a second number of plural pages within the physical buffer space of the buffer,

wherein the second number is greater than the first number,

wherein the multi-page pointer comprises a first multi-page pointer, and

wherein the expanding of the two-level tree structure into the multi-level tree structure comprises:

creating a second multi-page pointer at the top level of the tree structure to reference one or more first multi-page pointers at a middle level of the tree structure;

creating the one or more first multi-page pointers at the middle level of the tree structure with each of the first one or more multi-page pointers referencing one or more single pointers of a plurality of single-page pointers at the bottom level of the tree structure; and

creating the plurality of single-page pointers at the bottom level of the tree structure with each of the plurality of single-page pointers referencing a respective page within the physical buffer space of the buffer.

Assignments (6)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 31, 2023
From: FUNGIBLE, INC.
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 064434/0430 →
RELEASE OF SECURITY INTEREST Recorded Jan 9, 2023
From: HERCULES CAPITAL, INC., AS AGENT
To: FUNGIBLE, INC.
Reel/Frame 062335/0803 →
RELEASE OF SECURITY INTEREST Recorded Jan 5, 2023
From: SILICON VALLEY BANK
To: FUNGIBLE, INC.
Reel/Frame 062308/0191 →
SECURITY INTEREST Recorded Dec 16, 2021
From: FUNGIBLE, INC.
To: SILICON VALLEY BANK
Reel/Frame 058523/0960 →
SECURITY INTEREST Recorded Dec 16, 2021
From: FUNGIBLE, INC.
To: HERCULES CAPITAL, INC., AS AGENT
Reel/Frame 058533/0429 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 9, 2016
From: GOEL, DEEPAK; NOUREDDINE, WAEL; KIM, PAUL
To: FUNGIBLE INC.
Reel/Frame 040272/0723 →
Continuity (2)
Continuation In Part 15269457 · Sep 19, 2016
Related Publication 20180081567A1 · Mar 22, 2018