IP Library Granted Patent US 12,353,330
Granted Patent B2
US 12,353,330 · App. 18/054,388 · Granted Jul 8, 2025

Preemption techniques for memory-backed registers

Inventors: Benjiman L. Goodman (Austin, TX); Yoong Chert Foo (London, GB); Karl D. Mann (Orlando, FL); Terence M. Potter (Austin, TX); Frank W. Liljeros (Sanford, FL); Jeffrey T. Brady (Orlando, FL)
Assignee: Apple Inc.
G06F12/0891G06F12/0811G06F2212/6042
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,353,330
App. No.
18/054,388
Granted
Jul 8, 2025
Kind
B2
Abstract

Techniques are disclosed relating to thread preemption in the context of memory-backed registers. In some embodiments, a memory hierarchy includes one or more cache levels and one or more memory circuits. Execution circuitry may operate on operands in architectural registers to execute instructions of threads, where data for the architectural registers is stored and backed by the memory hierarchy. Control circuitry may, in response to a context switch indication for a given thread: flush and invalidate a set of architectural register data from a first cache level and store memory page information (e.g., a page catalog base address) associated with the set of architectural register data.

Claims (67)

1. A method, comprising:

operating, by a computing device, on operands in architectural registers to execute instructions of threads, wherein data for the architectural registers is stored and backed by a memory hierarchy that includes one or more cache levels and one or more memory circuits;

in response to a context switch indication for a given thread, the computing device:

identifying a set of cache lines at a first cache level that stored, prior to the context switch indication, a set of architectural register data for the given thread;

flushing and invalidating the identified set of cache lines; and

storing memory page information that indicates backing memory pages of the set of cache lines that were flushed and invalidated.

2. The method of claim 1 , wherein the memory page information includes a page catalog base address.

3. The method of claim 1 , further comprising:

allocating, by the computing device, one or more pages for the set of architectural register data; and

restoring, by the computing device, the one or more pages based on the stored memory page information in response to restoration of the thread.

4. The method of claim 3 , further comprising:

retrieving and caching, by the computing device, one or more pages in a page table cache based on the stored memory page information.

5. The method of claim 1 , further comprising:

accessing the first cache level using addresses in a private memory space for the given thread; and

using address information in a second memory space to store the memory page information.

6. The method of claim 5 , wherein the private memory space for the thread that is addressed at least in part based on hardware identifier information, the method further comprising:

storing, by the computing device, virtual hardware identifier information for the thread in response to the context switch indication and restoring the virtual hardware identifier information for the thread in response to restoration of the thread.

7. The method of claim 1 , further comprising:

storing, by the computing device, operand data in an operand cache at a level that is nearer, in the memory hierarchy, to execution circuitry than the first cache level.

8. A non-transitory computer-readable storage medium having stored thereon design information that specifies a design of at least a portion of a hardware integrated circuit, wherein the design information is usable by a semiconductor fabrication system to produce the circuit according to the design, including:

a memory hierarchy that includes one or more cache levels and one or more memory circuits;

execution circuitry configured to operate on operands in architectural registers to execute instructions of threads, wherein data for the architectural registers is stored and backed by the memory hierarchy under hardware control; and

control circuitry configured to, in response to a context switch indication for a given thread:

identify a set of cache lines at a first cache level that stored, prior to the context switch indication, a set of architectural register data for the given thread;

flush and invalidate the identified set of cache lines; and

store memory page information that indicates backing memory pages of the set of cache lines that were flushed and invalidated.

9. The non-transitory computer-readable storage medium of claim 8 , wherein the memory page information includes a page catalog base address.

10. The non-transitory computer-readable storage medium of claim 8 , wherein the circuit further includes:

memory allocator circuitry configured to:

allocate one or more pages for the set of architectural register data; and

restore the one or more pages based on the stored memory page information in response to restoration of the thread; and

memory management unit circuitry configured to retrieve and cache one or more pages based on the stored memory page information.

11. The non-transitory computer-readable storage medium of claim 8 , wherein the control circuitry is configured to:

access the first cache level using addresses in a private memory space for the given thread; and

use address information in a second memory space to store the memory page information.

12. An apparatus, comprising:

a memory hierarchy that includes one or more cache levels and one or more memory circuits;

execution circuitry configured to operate on operands in architectural registers to execute instructions of threads, wherein data for the architectural registers is stored and backed by the memory hierarchy under hardware control; and

control circuitry configured to, in response to a context switch indication for a given thread:

identify a set of cache lines at a first cache level that stored, prior to the context switch indication, a set of architectural register data for the given thread;

flush and invalidate the identified set of cache lines; and

store memory page information that indicates backing memory pages of the set of cache lines that were flushed and invalidated.

13. The apparatus of claim 12 , wherein the memory page information includes a page catalog base address.

14. The apparatus of claim 12 , further comprising:

memory allocator circuitry configured to:

allocate one or more pages for the set of architectural register data; and

restore the one or more pages based on the stored memory page information in response to restoration of the thread.

15. The apparatus of claim 14 , further comprising:

memory management unit circuitry configured to retrieve and cache one or more pages based on the stored memory page information.

16. The apparatus of claim 12 , wherein the control circuitry is configured to:

access the first cache level using addresses in a private memory space for the given thread; and

use address information in a second memory space to store the memory page information.

17. The apparatus of claim 16 , wherein:

the private memory space is addressed at least in part based on hardware identifier information; and

the control circuitry is configured to store virtual hardware identifier information for the thread in response to the context switch indication and restore the virtual hardware identifier information for the thread in response to restoration of the thread.

18. The apparatus of claim 12 , further comprising:

an operand cache configured to store operand data at a level that is nearer the execution circuitry in the memory hierarchy than the first cache level.

19. The apparatus of claim 12 , wherein the apparatus is a computing device that further includes:

a graphics processor that includes the execution circuitry and the control circuitry;

a central processing unit;

a display; and

network interface circuitry.

20. The apparatus of claim 12 , wherein the apparatus includes:

a plurality of single-instruction multiple-data pipelines configured to execute instructions; and

fixed-function circuitry configured to control the single-instruction multiple-data pipelines to perform operations for at least one of the following types of programs:

graphics shader programs; and

machine learning programs.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 10, 2022
From: GOODMAN, BENJIMAN L.; FOO, YOONG CHERT; MANN, KARL D.; POTTER, TERENCE M.; LILJEROS, FRANK W.; BRADY, JEFFREY T.
To: APPLE INC.
Reel/Frame 061722/0992 →
Continuity (2)
Provisional Application 63376176 · Sep 19, 2022
Related Publication 20240095176A1 · Mar 21, 2024
References Cited (50)
US 5974438A · Neufeld · 1999 [cited by applicant]
US 6105051A · Borkenhagen et al. · 2000 [cited by applicant]
US 6145054A · Mehrotra et al. · 2000 [cited by applicant]
US 7237093B1 · Musoll et al. · 2007 [cited by applicant]
US 7418576B1 · Lindholm et al. · 2008 [cited by applicant]
US 7478388B1 · Chen · 2009 [cited by examiner]
US 7895415B2 · Gonzalez · 2011 [cited by applicant]
US 8095778B1 · Golla · 2012 [cited by applicant]
US 8533719B2 · Fedorova · 2013 [cited by applicant]
US 10027587B1 · O'Brien et al. · 2018 [cited by applicant]
US 10089114B2 · Kulkarni et al. · 2018 [cited by applicant]
US 10585670B2 · Abdallah · 2020 [cited by applicant]
US 10642618B1 · Hakewill · 2020 [cited by applicant]
US 11301298B2 · Varma · 2022 [cited by applicant]
US 11314562B2 · Dice · 2022 [cited by applicant]
US 20040059896A1 · Kossman et al. · 2004 [cited by applicant]
US 20040060052A1 · Brown et al. · 2004 [cited by applicant]
US 20050114856A1 · Eickemeyer et al. · 2005 [cited by applicant]
US 20050210158A1 · Cowperthwaite · 2005 [cited by examiner]
US 20060179280A1 · Jensen et al. · 2006 [cited by applicant]
US 20070103476A1 · Huang · 2007 [cited by examiner]
US 20070143582A1 · Coon et al. · 2007 [cited by applicant]
US 20090210677A1 · Luick · 2009 [cited by applicant]
US 20100083267A1 · Adachi et al. · 2010 [cited by applicant]
US 20110276784A1 · Gewirtz et al. · 2011 [cited by applicant]
US 20120079503A1 · Dally et al. · 2012 [cited by applicant]
US 20130166881A1 · Choquette et al. · 2013 [cited by applicant]
US 20140160126A1 · Legakis et al. · 2014 [cited by applicant]
US 20140282566A1 · Lindholm · 2014 [cited by applicant]
US 20150046684A1 · Mehrara et al. · 2015 [cited by applicant]
US 20160246728A1 · Ron · 2016 [cited by examiner]
US 20160292814A1 · Holland et al. · 2016 [cited by applicant]
US 20180046577A1 · Chen et al. · 2018 [cited by applicant]
US 20180181491A1 · DeLaurier · 2018 [cited by examiner]
US 20190018676A1 · Alexander et al. · 2019 [cited by applicant]
US 20190340019A1 · Brewer · 2019 [cited by applicant]
US 20190370059A1 · Puthoor et al. · 2019 [cited by applicant]
US 20200043123A1 · Dash · 2020 [cited by applicant]
US 20200293450A1 · Vemulapalli et al. · 2020 [cited by applicant]
US 20210073450A1 · Boesch · 2021 [cited by applicant]
US 20210342158A1 · Brewer · 2021 [cited by applicant]
US 20210382717A1 · Jiang · 2021 [cited by applicant]
US 20220043413A1 · Heydari · 2022 [cited by applicant]
US 20220091657A1 · Tsien · 2022 [cited by examiner]
US 20220100484A1 · Abu-Ghazaleh et al. · 2022 [cited by applicant]
US 20220206876A1 · Beckmann et al. · 2022 [cited by applicant]
US 20230367676A1 · Jeyapaul · 2023 [cited by examiner]
US 20230401132A1 · Patle · 2023 [cited by examiner]
WO 2008061154A3 · 2008 [cited by applicant]
WO 2013098643A2 · 2013 [cited by applicant]