Community
cancel
Showing results for 
Search instead for 
Did you mean: 
ASing3
Beginner
355 Views

appropriate perf events for lock contention related stalls

I Intend to measure the number of cycles different cores of a CPU waste, when there is contention for a lock in a multi-threaded program. Some cycles would be consumed by cache coherence hardware, some by atomic instructions which are part of lock function, some by QPI hardware when threads are placed on cores on different sockets, some when OS put a thread/core in low power C states etc.

I would like to know a set of suitable perf events to record. processor that I run my experimetns are Xeon gold 6148 CPU @ 2.4 GHZ and Xeon  E7-8890 v4 @ 2.2GHZ.

Also the base frequency of both the CPU are different. How should I compare cycle count for an event recorded on both the processor.

thanks

Ajit

Tags (1)
0 Kudos
3 Replies
Bernard
Black Belt
268 Views

You may start your searching  here.

Also the base frequency of both the CPU are different. How should I compare cycle count for an event recorded on both the processor.

thanks

You may designate the older CPU as a baseline system and measure the difference between those two processors. At least I would disable the boost frequency on both processors, set the thread affinity to specific core or rise the measured thread priority in order to minimize the number of context-switches. The statistical distribution of the results would be a problem (I presume, that you will use probably a counting mode) and I rarely seen a Gaussian distribution, although I do not collected more than 100 samples.

ASing3
Beginner
261 Views

Thanks Bernard. I am aware of the link you forwarded. Problem is the brief description of events is really 'brief', often using jargon's.  Beside that, even if you use wrong code and mask, you get some value, sometime '0', sometime some random number. In case of invalid mask and event code, some error code would have been better. It is not the case. Is there a better reference that you are aware of beside Intel manuals.

thanks

Ajit

Tags (1)
Bernard
Black Belt
254 Views

Hi,

I know your pain, I'm dealing with same issues.

I do not know if this will suite your needs, but this probably a most detailed information (as far as I know) in regards to performance events (You may already know that).

An additional information may be found in Intel SDM.

Hope it helps

 

P.s.

        Remove the "txt" file extension and add "json"

 

Reply