IP Library Granted Patent US 9,436,501
Granted Patent B2
US 9,436,501 · App. 14/468,567 · Granted Sep 6, 2016

Thread-based cache content saving for task switching

Inventors: Harold W. Cain, III (Raleigh, NC); David M. Daly (Croton on Hudson, NY); Brian R. Prasky (Campbell Hall, NY); Vijayalakshmi Srinivasan (New York, NY)
Assignee: INTERNATIONAL BUSINESS MACHINES CORPORATION
G06F9/461G06F9/4843G06F9/5016G06F12/0862G06F12/0875G06F12/0891G06F12/0897G06F2212/1024G06F2212/251G06F2212/452G06F2212/602G06F2212/6022G06F2212/69
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 9,436,501
App. No.
14/468,567
Granted
Sep 6, 2016
Kind
B2
Abstract

Embodiments relate to thread-based cache content savings for task switching in a computer processor. An aspect includes determining a cache entry in a cache of the computer processor that is owned by the first thread, wherein the determination is made based on a hardware thread identifier (ID) of the first thread matching a hardware thread ID in the cache entry. Another aspect includes determining whether the determined cache entry is eligible for prefetching. Yet another aspect includes, based on determining that the determined cache entry is eligible for prefetching, setting a marker in the cache entry to active.

Claims (24)

1. A system for thread-based cache content saving for task switching in a computer processor, the system comprising:

a memory; and

the computer processor, communicatively coupled to said memory, the computer system configured to perform a method comprising:

based on a task switch in the computer processor from a first thread to a second thread:

determining a cache entry in a cache of the computer processor that is owned by the first thread, wherein the determination is made based on a hardware thread identifier (ID) of the first thread matching a hardware thread ID in the cache entry;

wherein the hardware thread ID of the first thread comprises an index of a software thread ID of the first thread in a thread ID table of the computer processor, and wherein the thread ID table comprises a list of software thread IDs corresponding to most recently executed threads in the computer processor, wherein each software thread ID in the thread ID table has a corresponding respective index in the thread ID table that comprises a hardware thread ID of a thread corresponding to the software thread ID;

determining whether the determined cache entry is eligible for prefetching; and

based on determining that the determined cache entry is eligible for prefetching, setting a marker in the cache entry to active.

2. The computer system of claim 1 , the method further comprising:

selecting a cache entry from the cache for eviction;

determining whether the hardware thread ID of the selected cache entry is not equal to a hardware thread ID of the second thread;

determining whether the marker of the selected cache entry is set to active; and

based on determining that the hardware thread ID of the selected cache entry is not equal to the hardware thread ID of the second thread and that the marker of the selected cache entry is set to active, saving an address of the selected cache entry to a staging buffer.

3. The computer system of claim 2 , wherein the computer processor comprises a plurality of staging buffers, wherein each staging buffer corresponds to a respective entry in the thread ID table, and further comprising writing contents of a staging buffer of the plurality of staging buffers to a partition footprint log area (PFLA) storage in a main memory or a higher level cache based on the staging buffer being full.

4. The computer system of claim 1 , the method further comprising, based on the task switch:

determining whether a software thread ID of the second thread matches an entry in the thread ID table;

based on determining that the software thread ID of the second thread matches an entry in the thread ID table, setting an active hardware thread ID of the computer processor equal to an index of the determined cache entry in the thread ID table; and

based on determining that the software thread ID of the second thread does not match any entry in the thread ID table:

evicting an entry from the thread ID table;

replacing the evicted entry with a new entry corresponding to the software thread ID of the second thread; and

setting the active hardware thread ID of the computer processor equal to an index of the new entry in the thread ID table.

5. The computer system of claim 4 , further comprising, based on creating a new cache entry during execution of the second thread, setting a hardware thread ID in the new cache entry equal to the active hardware thread ID.

6. The computer system of claim 1 , wherein determining whether the determined cache entry is eligible for prefetching comprises determining a position of the determined cache entry in a least recently used (LRU) stack of the cache.

7. The computer system of claim 1 , wherein determining whether the determined cache entry is eligible for prefetching comprises determining a frequency of usage of the determined cache entry based on a frequency counter that is associated with the determined cache entry.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 26, 2014
From: CAIN, HAROLD W., III; DALY, DAVID M.; PRASKY, BRIAN R.; SRINIVASAN, VIJAYALAKSHMI
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 033609/0487 →
Continuity (1)
Related Publication 20160062899A1 · Mar 3, 2016