IP Library Granted Patent US 9,547,599
Granted Patent B2
US 9,547,599 · App. 14/341,438 · Granted Jan 17, 2017

System and method for predicting false sharing

Inventors: Chen Tian (Union City, CA); Tongping Liu (Amherst, MA); Ziang Hu (Union City, CA)
Assignee: FUTUREWEI TECHNOLOGIES, INC.
G06F12/0842G06F8/443G06F11/3003G06F11/3466G06F11/3471G06F11/3093G06F11/3428G06F2201/865G06F2201/885
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,547,599
App. No.
14/341,438
Granted
Jan 17, 2017
Kind
B2
Abstract

In one embodiment, a method for predicting false sharing includes running code on a plurality of cores and tracking potential false sharing in the code while running the code to produce tracked potential false sharing, where tracking the potential false sharing includes determining whether there is potential false sharing between a first cache line and a second cache line, and where the first cache line is adjacent to the second cache line. The method also includes reporting potential false sharing in accordance with the tracked potential false sharing to produce a false sharing report.

Claims (44)

1. A method for predicting false sharing, the method comprising:

running code on a plurality of cores;

tracking potential false sharing in the code, while running the code, to produce tracked potential false sharing, wherein tracking the potential false sharing comprises determining whether there is potential false sharing between a first cache line and a second cache line, wherein the first cache line is adjacent to the second cache line, and wherein potential false sharing does not manifest currently in the code being run; and

reporting potential false sharing in accordance with the tracked potential false sharing to produce a potential false sharing report.

2. The method of claim 1 , wherein tracking the potential false sharing comprises:

tracking a number of write accesses to the first cache line; and

tracking detailed information for a first plurality of accesses to the first cache line when the number of write accesses for the first cache line is greater than a tracking threshold.

3. The method of claim 2 , wherein tracking the detailed information comprises tracking a plurality of access types of the first plurality of accesses, a plurality of threads performing the first plurality of accesses, and a plurality of words accessed by the first plurality of accesses.

4. The method of claim 2 , wherein tracking the potential false sharing further comprises:

determining whether a number of write accesses is greater than a predicting threshold while tracking the detailed information for the first plurality of accesses; and

determining whether there is potential false sharing in the first cache line when the number of write accesses is greater than the predicting threshold.

5. The method of claim 2 , wherein the first cache line is before the second cache line.

6. The method of claim 2 , wherein the first cache line is after the second cache line.

7. The method of claim 1 , wherein reporting the potential false sharing comprises reporting a false sharing incident when the false sharing incident is not previously reported.

8. The method of claim 1 , wherein the code comprises instrumentation.

9. The method of claim 1 , wherein reporting the potential false sharing comprises reporting a name of a global variable, an address of the global variable, and a size of the global variable.

10. The method of claim 1 , wherein reporting the potential false sharing comprises reporting a callsite stack for an allocation of a heap object, an address of the heap object, and a size of the heap object.

11. The method of claim 1 , wherein reporting the potential false sharing comprises reporting a first task corresponding to a first access of a first word the first cache line and a second task corresponding to a second access of a second word the second cache line.

12. The method of claim 1 , wherein reporting the potential false sharing comprises examining metadata corresponding to the first cache line and the second cache line.

13. The method of claim 1 , wherein tracking the potential false sharing comprises:

determining a first word of the first cache line, wherein the first word of the first cache line has a number of accesses greater than a threshold; and

searching a plurality of words within a size of the first cache line of the first word for potential false sharing.

14. The method of claim 1 , wherein tracking the potential false sharing comprises tracking a virtual line having a virtual cache line size, wherein the virtual cache line size is the same as a size of the first cache line, wherein the virtual line has a starting address of X−((sz−d)/2) and an ending address of Y+((sz−d)/2, wherein X is a position of a first access to the first cache line, Y is a position of a second access to the second cache line, sz is the size of the first cache line, and d is a distance between the first access and the second access.

15. A method for predicting false sharing, the method comprising:

performing a first access to a first cache line by a first thread;

performing a second access to a second cache line by a second thread, wherein the first cache line is adjacent to the second cache line;

determining a distance between the first access and the second access; and

identifying a potential false sharing incident when the distance between the first access and the second access is less than a size of the first cache line, wherein potential false sharing does not manifest in running code.

16. The method of claim 15 , wherein the first access and the second access are hot accesses, and wherein hot accesses are accesses made to the same address for more than an average number of accesses.

17. The method of claim 15 , further comprising:

determining whether the first access is a read access or a write access; and

determining whether the second access is a read access or a write access, wherein identifying the potential false sharing incident comprises identifying the potential false sharing incident when the first access is a write access or the second access is a write access.

18. The method of claim 15 , wherein identifying the potential false sharing incident comprises:

tracking invalidations in a virtual cache line to produce a plurality of tracked invalidations; and

ranking the plurality of tracked invalidations.

19. The method of claim 15 , wherein identifying the potential false sharing incident comprises:

recording a portion of accesses of the first cache line; and

tracking a changing pattern of a plurality of accesses to the first cache line and the second cache line.

20. A computer comprising:

a first processor;

a second processor; and

a non-transitory computer readable storage medium storing programming for execution by the first processor and the second processor, wherein the programming comprises instrumentation, the programming including instructions to:

track potential false sharing in the programming to produce tracked potential false sharing, wherein the instructions to track the potential false sharing comprises instructions to determine whether there is potential false sharing between a first cache line and a second cache line, wherein the first cache line is adjacent to the second cache line, and wherein potential false sharing does not manifest in the programming, and

report potential false sharing in accordance with the tracked potential false sharing to produce a potential false sharing report.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 17, 2014
From: TIAN, CHEN; LIU, TONGPING; HU, ZIANG
To: FUTUREWEI TECHNOLOGIES, INC.
Reel/Frame 034190/0244 →
Continuity (2)
Provisional Application 61858857 · Jul 26, 2013
Related Publication 20150032971A1 · Jan 29, 2015