Software Tuning, Performance Optimization & Platform Monitoring
Discussion regarding monitoring and software tuning methodologies, Performance Monitoring Unit (PMU) of Intel microprocessors, and platform updating.

performance monitoring PMI

yao__cody
Beginner
1,809 Views

Dear all,

This is a question about performance monitoring interrupt based on PMU in uncore。

In Linux kernel,I can not find the code supported this feature when uncore counter overflow, which poll these counter with setting hrtimer.

Then, I write these control and counter register through msr tools, and print info in perf_event_nmi_handler to confirm whether pmi is sended, but no info printed.

So I want to know whether pmi is supported in uncore,because I find this feature in uncore spec.

 

thanks

cody

 

 

0 Kudos
1 Solution
McCalpinJohn
Honored Contributor III
1,809 Views

Only a few Intel processors support interrupt generation for uncore performance counter overflow, so I would not be surprised if the Linux kernel folks decided that it was not worth the effort to support.  (But I have not run across any discussions of this particular topic, so I don't know for sure.)

One of the main reasons for supporting interrupt on overflow is so that the interrupt handler can unwind the user stack and associate the overflow with the execution of a specific piece of code.   With very few exceptions, uncore performance counter events can't be associated with specific cores, so it is not typically possible to associate the event with a particular core and/or a particular user thread.

View solution in original post

0 Kudos
3 Replies
McCalpinJohn
Honored Contributor III
1,810 Views

Only a few Intel processors support interrupt generation for uncore performance counter overflow, so I would not be surprised if the Linux kernel folks decided that it was not worth the effort to support.  (But I have not run across any discussions of this particular topic, so I don't know for sure.)

One of the main reasons for supporting interrupt on overflow is so that the interrupt handler can unwind the user stack and associate the overflow with the execution of a specific piece of code.   With very few exceptions, uncore performance counter events can't be associated with specific cores, so it is not typically possible to associate the event with a particular core and/or a particular user thread.

0 Kudos
yao__cody
Beginner
1,809 Views

 I understand what you mean, thank you very much ^_^

This feature is mentioned in uncore performance monitoring manual,so the uncore PMI may have other functions.  Although Linux kernel doesn't support, it Is there any way to  test whether this feature is supported on hardware in my platform?  

0 Kudos
McCalpinJohn
Honored Contributor III
1,809 Views

If the uncore performance monitoring guide says that the feature is supported by your processor, then it probably works as described.  It looks easy enough to set up the U_MSR_PMON_GLOBAL_CTL register to enable uncore PMIs, and it is certainly easy to enable interrupt on overflow in the various unit performance monitor control registers (by setting bit 20 in addition to whatever else you are counting).   I don't know anything about how the interrupt handler is implemented, but if one is not present the system will probably log a message of the form:

Uhhuh. NMI received for unknown reason xx on CPU yy.

Interrupt on overflow of an uncore performance counter is still a useful feature for socket-level monitoring -- especially for the uncore counters that are related to error conditions. 

0 Kudos
Reply