IP Library › Granted Patent US 10,754,776
Granted Patent B2
US 10,754,776 · App. 16/048,871 · Granted Aug 25, 2020

Cache balance when using hardware transactional memory

Inventors: Daniel Battaiola Kreling (Santa Bárbara d'Oeste, BR); Breno H. Leitao (Araraquara, BR); Mauro Sergio Martins Rodrigues (Campinas, BR); Rafael Camarda Silva Folco (Santa Bárbara d'Oeste, BR)
Assignee: INTERNATIONAL BUSINESS MACHINES CORPORATION
G06F12/0815G06F12/0804G06F2212/1032G06F2212/154
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,754,776
App. No.
16/048,871
Granted
Aug 25, 2020
Kind
B2
Abstract

Systems and methods for cache balance when using hardware transactional memory are disclosed. A method includes: determining, by a computing device, a hardware transactional memory (HTM) attrition rate for a workload in a distributed computing environment; determining, by the computing device, whether or not the HTM attrition rate for the workload exceeds a predetermined threshold; and in response to determining that the HTM attrition rate for the workload does not exceed the predetermined threshold, the computing device causing a requested HTM transaction to begin.

Claims (46)

1. A method comprising:

determining, by a computing device, a hardware transactional memory (HTM) attrition rate for a workload for a current block of cycles in a distributed computing environment;

determining, by the computing device, that the HTM attrition rate for the workload for the current block of cycles exceeds a predetermined threshold;

in response to determining that the HTM attrition rate for the workload for the current block of cycles exceeds the predetermined threshold, the computing device determining whether or not the HTM attrition rate has exceeded the predetermined threshold in each of a predetermined number of blocks of cycles preceding the current block of cycles; and

in response to determining that the HTM attrition rate has not exceeded the predetermined threshold in each of the predetermined number of blocks of cycles preceding the current block of cycles, the computing device causing a requested HTM transaction to begin.

2. The method according to claim 1 , wherein the determining the HTM attrition rate for the workload comprises:

receiving information on a number of times a cache has been flushed due to HTM transactions;

receiving information on a number of cache misses; and

calculating the HTM attrition rate using the received information on the number of times the cache has been flushed due to HTM transactions and the received information on the number of cache misses.

3. The method according to claim 2 , wherein:

the determining the HTM attrition rate for the workload further comprises storing the calculated HTM attrition rate in a memory of the computing device.

4. The method according to claim 1 , further comprising:

in response to determining that the HTM attrition rate has exceeded the predetermined threshold in each of the predetermined number of blocks of cycles preceding the current block of cycles, the computing device preventing the requested HTM transaction from beginning.

5. The method according to claim 4 , wherein the preventing the requested HTM transaction from beginning comprises the computing device forcing the workload to fallback to software transactional memory.

6. The method according to claim 5 , wherein the forcing the workload to fallback to software transactional memory comprises returning HTM_BUSY to the workload.

7. The method according to claim 1 , wherein the predetermined threshold is determined based on an operating system environment variable or kernel parameter.

8. The method according to claim 1 , wherein the HTM attrition rate is determined using a FLUSH_BY_HTM metric.

9. The method according to claim 8 , wherein the FLUSH_BY_HTM metric is a performance monitoring unit metric that assesses flush of cache lines due to HTM transaction growth.

10. The method according to claim 9 , wherein the cache lines are in an L1 cache.

11. A computer program product comprising a computer readable storage medium having program instructions embodied therewith, the program instructions executable by a computing device to cause the computing device to:

receive information on a number of times a cache has been flushed due to hardware transactional memory (HTM) transactions;

receive information on a number of cache misses;

determine that an HTM attrition rate for a workload in a distributed computing environment exceeds a predetermined threshold, using the received information on the number of times the cache has been flushed due to HTM transactions and the received information on the number of cache misses;

in response to determining that the HTM attrition rate for the workload exceeds the predetermined threshold, determining whether or not the HTM attrition rate has exceeded the predetermined threshold in each of a predetermined number of blocks of cycles preceding a current block of cycles; and

in response to determining that the HTM attrition rate has exceeded the predetermined threshold in each of the predetermined number of blocks of cycles preceding the current block of cycles, preventing an HTM transaction requested by the workload from beginning in response to a size of the HTM transaction exceeding a predetermined maximum HTM transaction size.

12. The computer program product according to claim 11 , further comprising:

in response to determining that the HTM attrition rate has not exceeded the predetermined threshold in each of the predetermined number of blocks of cycles preceding the current block of cycles, permitting the HTM transaction to begin.

13. The computer program product according to claim 11 , wherein the preventing the HTM transaction from beginning comprises forcing the workload to fallback to software transactional memory.

14. The computer program product according to claim 13 , wherein the forcing the workload to fallback to software transactional memory comprises returning HTM_BUSY to the workload.

15. The computer program product according to claim 11 , further comprising:

in response to determining that the HTM attrition rate has exceeded the predetermined threshold in each of the predetermined number of blocks of cycles preceding the current block of cycles, permitting the HTM transaction to begin in response to the size of the HTM transaction not exceeding the predetermined maximum HTM transaction size.

16. A system comprising:

a hardware processor, a computer readable memory, and a computer readable storage medium associated with a computing device;

program instructions configured to determine a hardware transactional memory (HTM) attrition rate for a workload for a current block of cycles in a distributed computing environment;

program instructions configured to determine that the HTM attrition rate for the workload for the current block of cycles exceeds a predetermined threshold;

program instructions configured to determine whether or not the HTM attrition rate has exceeded the predetermined threshold in each of a predetermined number of blocks of cycles preceding the current block of cycles in response to determining that the HTM attrition rate for the workload for the current block of cycles exceeds the predetermined threshold; and

program instructions configured to cause a requested HTM transaction to begin in response to determining that the HTM attrition rate has not exceeded the predetermined threshold in each of the predetermined number of blocks of cycles preceding the current block of cycles,

wherein the program instructions are stored on the computer readable storage medium for execution by the hardware processor via the computer readable memory.

17. The system according to claim 16 , wherein the determining the HTM attrition rate for the workload comprises:

receiving information on a number of times a cache has been flushed due to HTM transactions;

receiving information on a number of cache misses; and

calculating the HTM attrition rate using the received information on the number of times the cache has been flushed due to HTM transactions and the received information on the number of cache misses.

18. The system according to claim 17 , wherein:

the determining the HTM attrition rate for the workload further comprises storing the calculated HTM attrition rate in a memory of the computing device.

19. The system according to claim 16 , further comprising program instructions configured to prevent the requested HTM transaction from beginning, in response to determining that the HTM attrition rate has exceeded the predetermined threshold in each of the predetermined number of blocks of cycles preceding the current block of cycles.

20. The system according to claim 19 , wherein the preventing the requested HTM transaction from beginning comprises the computing device forcing the workload to fallback to software transactional memory.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 13, 2021
From: INTERNATIONAL BUSINESS MACHINES CORPORATION
To: KYNDRYL, INC.
Reel/Frame 057885/0644 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 30, 2018
From: BATTAIOLA KRELING, DANIEL; LEITAO, BRENO H.; MARTINS RODRIGUES, MAURO SERGIO; CAMARDA SILVA FOLCO, RAFAEL
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 046501/0483 →
Continuity (1)
Related Publication 20200034295A1 · Jan 30, 2020