IP Library Granted Patent US 12,265,474
Granted Patent B2
US 12,265,474 · App. 18/490,588 · Granted Apr 1, 2025

On-demand memory allocation

Inventors: Justin A. Hensley (Mountain View, CA); Karl D. Mann (Geneva, FL); Yoong Chert Foo (London, GB); Terence M. Potter (Austin, TX); Frank W. Liljeros (Sanford, FL); Ralph C. Taylor (Deland, FL)
Assignee: Apple Inc.
G06F12/1018G06F12/084G06F12/1036G06F30/392G06F2212/622G06F2212/651
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 12,265,474
App. No.
18/490,588
Granted
Apr 1, 2025
Kind
B2
Abstract

Techniques are disclosed relating to dynamically allocating and mapping private memory for requesting circuitry. Disclosed circuitry may receive a private address and translate the private address to a virtual address (which an MMU may then translate to physical address to actually access a storage element). In some embodiments, private memory allocation circuitry is configured to generate page table information and map private memory pages for requests if the page table information is not already setup. In various embodiments, this may advantageously allow dynamic private memory allocation, e.g., to efficiently allocate memory for graphics shaders with different types of workloads. Disclosed caching techniques for page table information may improve performance relative to traditional techniques. Further, disclosed embodiments may facilitate memory consolidation across a device such as a graphics processor.

Claims (51)

1. An apparatus, comprising:

first and second client circuits configured to request to access a private memory space;

memory allocation circuitry configured to map private memory pages in the private memory space to a virtual address space;

cache circuitry configured to cache page table information corresponding to the mapped private memory pages, wherein the cached page table information is accessible to both the first and second client circuits; and

memory management circuitry configured to translate addresses in the virtual address space to addresses in a physical memory space.

2. The apparatus of claim 1 , wherein the cache circuitry is dedicated to caching page table information and is independent from a data cache included in the apparatus.

3. The apparatus of claim 1 , wherein the cache circuitry includes a page directory cache and a page catalog cache.

4. The apparatus of claim 1 , further comprising second cache circuitry at a lower level than the cache circuitry, wherein the second cache circuitry is configured to cache page table information for a single client circuit.

5. The apparatus of claim 1 , further comprising:

page management circuitry configured to:

maintain a count of available pages in the virtual address space; and

in response to a page reserve request when sufficient pages are available to grant the request, adjust the count and provide a page grant response.

6. The apparatus of claim 1 , wherein the memory allocation circuitry includes multiple distributed units that are each dedicated to a set of shader processors and a global unit configured to communicate with the distributed units to manage page requests.

7. The apparatus of claim 1 , wherein the memory allocation circuitry is further configured to:

process a translate-no-map request that specifies to translate a private address to a virtual address if a corresponding private memory page is mapped to a virtual address for the private address, but not to map a private virtual page for the address otherwise.

8. A method, comprising:

requesting, by a computing device, to access a private memory space using a first address;

in response to determining that a page is not mapped for the first address, the computing device generating page table information for the private memory space and mapping a private memory page for the first address to a virtual address space;

generating, by the computing device, a virtual address for the request based on the mapped private memory page;

maintaining, by the computing device, a count of available pages in the virtual address space;

in response to a page reserve request when sufficient pages are available to grant the request, the computing device adjusting the count and provide a page grant response; and

translating, by the computing device, the virtual address to a physical address.

9. The method of claim 8 , further comprising:

freeing, by the computing device, a page in response to one or more unmap requests.

10. The method of claim 9 , further comprising:

maintaining, by the computing device, validity information corresponding to entries in page table pages; and

wherein the freeing is performed in response to the one or more unmap request causing the page to have no valid page table entries.

11. The method of claim 10 , wherein the validity information is encoded using at least one of the following types of encodings:

bit mask that indicates validity of entries; and

counter information that indicates a number of valid entries.

12. An apparatus, comprising:

client circuitry configured to request to access a private memory space using a first address;

memory allocation circuitry configured to:

in response to determining that a page is not mapped for the first address, generate page table information for the private memory space and map a private memory page for the first address to a virtual address space; and

generate a virtual address for the request based on the mapped private memory page;

page management circuitry configured to:

maintain a count of available pages in the virtual address space; and

in response to a page reserve request when sufficient pages are available to grant the request, adjust the count and provide a page grant response; and

memory management circuitry configured to translate the virtual address to a physical address.

13. The apparatus of claim 12 , wherein the page management circuitry is configured to free a page and adjust the count in response to one or more unmap requests.

14. The apparatus of claim 13 , wherein the page management circuitry is configured to maintain validity information corresponding to entries in page table pages and free the page in response to the one or more unmap request causing the page to have no valid page table entries.

15. The apparatus of claim 14 , wherein the validity information is encoded using at least one of the following types of encodings:

bit mask that indicates validity of entries; and

counter information that indicates a number of valid entries.

16. The apparatus of claim 12 , wherein the memory allocation circuitry includes multiple distributed units that are each dedicated to a set of shader processors and a global unit configured to communicate with the distributed units to manage page requests.

17. The apparatus of claim 12 , wherein the memory allocation circuitry is further configured to:

process a translate-no-map request that specifies to translate a private address to a virtual address if a corresponding private memory page is mapped to a virtual address for the private address, but not to map a private virtual page for the address otherwise.

18. The apparatus of claim 12 , wherein the memory allocation circuitry is further configured to:

unmap a virtual page from a private memory page in response to an unmap request.

19. The apparatus of claim 12 , wherein, to generate a virtual address for the request based on the mapped private memory page, the memory allocation circuitry is configured to access multiple levels of a page table hierarchy based on portions of the first address.

20. The apparatus of claim 12 , wherein the memory allocation circuitry is configured to access a first page table hierarchy to translate the first address to the virtual address and the memory management circuitry is configured to access a second page table hierarchy to translate the virtual address to the physical address.

Continuity (2)
Continuation 16804128 · Feb 28, 2020
Related Publication 20240045808A1 · Feb 8, 2024
References Cited (21)
US 5873120A · Harvey et al. · 1999 [cited by applicant]
US 9448930B2 · Asaro et al. · 2016 [cited by applicant]
US 11829298B2 · Hensley · 2023 [cited by examiner]
US 20120236010A1 · Ginzburg et al. · 2012 [cited by applicant]
US 20140281356A1 · Buschardt et al. · 2014 [cited by applicant]
US 20150206277A1 · Rao · 2015 [cited by examiner]
US 20170075818A1 · Liu et al. · 2017 [cited by applicant]
US 20170123996A1 · Kishan et al. · 2017 [cited by applicant]
US 20170181079A1 · Sauer et al. · 2017 [cited by applicant]
US 20180081816A1 · Coburn et al. · 2018 [cited by applicant]
US 20180089794A1 · Gopalakrishnan et al. · 2018 [cited by applicant]
US 20200065013A1 · Griffith et al. · 2020 [cited by applicant]
US 20200201758A1 · Asaro et al. · 2020 [cited by applicant]
EP 0919928A2 · 1999 [cited by applicant]
Nathan Brookwood, “NVIDIA Solves the GPU Computing Puzzle,” an Insight 64 White Paper; Sponsored by NVIDIA; Sep. 2009, 9 pages. [cited by applicant]
International Search Report and Written Opinion in PCT Appl. No. PCT/US2021/019353 mailed Jun. 17, 2021, 12 pages. [cited by applicant]
Appendix A “Hardware Description Languages” from Neil Weste, David Harris (2010) “CMOS VLSI Design: A Circuits and Systems Perspective” (4th Edition); http://pages.hmc.edu/harris/cmosvlsi/4e/cmosvlsidesign_4e_App.pdf; p… [cited by applicant]
“Hardware description language”; Wikipedia; https://en.wikipedia.org/w/index.php?title=Hardware_description_language&oldid=1055897548; last edited on Nov. 18, 2021, 11 pages. [cited by applicant]
Bathen et al. “SPMVisor: Dynamic ScratchPad Memory Virtualization for Secure, Low Power, and High Performance Distributed On-Chip Memories.” Oct. 2011. ACM. CODES+ISSS'11. pp. 79-88. [cited by applicant]
Tian et al. “A Full GPU Virtualization Solution with Mediated Pass-Through.” Jun. 2014. USENIX. ATC '14. pp. 121-132. [cited by applicant]
Xing et al. “Intel® Software Guard Extensions (Intel® SGX) Software Support for Dynamic Memory Allocation inside an Enclave.” Jun. 2016. ACM. HASP 2016. pp. 1-9. [cited by applicant]