[P9][Ubuntu 16.04.03] Additional PMU fixes for P9

Bug #1711104 reported by bugproxy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
The Ubuntu-power-systems project
Fix Released
High
Canonical Kernel Team
linux (Ubuntu)
Fix Released
High
Joseph Salisbury
Zesty
Fix Released
High
Joseph Salisbury

Bug Description

== Comment: #0 - Shriya R. Kulkarni <email address hidden> - 2017-08-16 04:07:45 ==
Please integrate the following PMU fixes for P9.

93fc5ca9a0048c ('powerpc/perf: Cleanup of PM_BR_CMPL vs. PM_BRU_CMPL in Power9 event list')
91e0bd1e62519b ('powerpc/perf: Add PM_LD_MISS_L1 and PM_BR_2PATH to power9 event list')
70a7e720998d5b ('powerpc/perf: Factor out PPMU_ONLY_COUNT_RUN check code from power8')
7aa345d84245a7 ('powerpc/perf: Update default sdar_mode value for power9')
101dd590a7fa37 ('powerpc/perf: Avoid spurious PMU interrupts after idle')
bdd21ddb919d28 ('powerpc/perf: Avoid spurious PMU interrupts after idle on Power9')
3f0bd8dad0db73 ('powerpc/perf: Add POWER9 alternate PM_RUN_CYC and PM_RUN_INST_CMPL events')
20dd4c624d2515 ('powerpc/perf: Fix SDAR_MODE value for continous sampling on Power9')
24bedcb7c81137 ('powerpc/perf: Fix branch event code for power9')
8c218578fcbbbd ('powerpc/perf: Fix Power9 test_adder fields')

bugproxy (bugproxy)
tags: added: architecture-ppc64le bugnameltc-157728 severity-high targetmilestone-inin16043
Changed in ubuntu:
assignee: nobody → Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage)
affects: ubuntu → perforate (Ubuntu)
Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2017-08-21 01:45 EDT-------
These additional patches are also needed.

f2080b9ac3c45 ('powerpc/perf: Add Power8 mem_access event to sysfs')
d148c94c27a87 ('powerpc/perf: Support to export SIERs bit in Power9')
453ce7a9432ee ('powerpc/perf: Support to export SIERs bit in Power8')
170a315f41c64 ('powerpc/perf: Support to export MMCRA[TEC*] field to userspace')
79e96f8f930d4 ('powerpc/perf: Export memory hierarchy info to user space')
8c5073db0ee68 ('powerpc/perf: Define big-endian version of perf_mem_data_src')

These are all upstreamed.

------- Comment From <email address hidden> 2017-08-21 02:56 EDT-------
marking it external ...

Changed in ubuntu-power-systems:
importance: Undecided → High
Manoj Iyer (manjo)
tags: added: triage-a
Manoj Iyer (manjo)
Changed in perforate (Ubuntu):
importance: Undecided → High
Manoj Iyer (manjo)
affects: linux → linux (Ubuntu)
Changed in linux (Ubuntu):
assignee: nobody → Canonical Kernel Team (canonical-kernel-team)
importance: Undecided → High
Changed in ubuntu-power-systems:
assignee: nobody → Canonical Kernel Team (canonical-kernel-team)
Revision history for this message
Manoj Iyer (manjo) wrote :

IBM, How does this bug affect package perforate ? These patches seem to be kernel patches.

Changed in perforate (Ubuntu):
status: New → Invalid
Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2017-08-28 14:42 EDT-------
(In reply to comment #7)
> IBM, How does this bug affect package perforate ? These patches seem to be
> kernel patches.

Looks like that was a mistake in the mirror request. These are all kernel/perf changes. I am not sure how to fix the mirrored package from our bugzilla side.. can this please be corrected from the launchpad side? Thanks!

tags: added: kernel-da-key
no longer affects: perforate (Ubuntu)
Changed in linux (Ubuntu Zesty):
status: New → Triaged
Changed in linux (Ubuntu Xenial):
status: New → Triaged
Changed in linux (Ubuntu):
status: New → Triaged
Changed in linux (Ubuntu Xenial):
importance: Undecided → High
Changed in linux (Ubuntu Zesty):
importance: Undecided → High
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

It looks like these patches are all in linux-next. Can you post a comment here when they land in mainline?

no longer affects: linux (Ubuntu Xenial)
no longer affects: perforate (Ubuntu Xenial)
Frank Heimes (fheimes)
Changed in ubuntu-power-systems:
status: New → Triaged
Changed in ubuntu-power-systems:
status: Triaged → Incomplete
Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2017-09-11 17:23 EDT-------
Looks like all but one of the patches are now in mainline:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=93fc5ca9a0048c
powerpc/perf: Cleanup of PM_BR_CMPL vs. PM_BRU_CMPL in Power9 event list
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=91e0bd1e62519b
powerpc/perf: Add PM_LD_MISS_L1 and PM_BR_2PATH to power9 event list
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=70a7e720998d5b
powerpc/perf: Factor out PPMU_ONLY_COUNT_RUN check code from power8
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7aa345d84245a7
powerpc/perf: Update default sdar_mode value for power9
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=101dd590a7fa37
powerpc/perf: Avoid spurious PMU interrupts after idle
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3f0bd8dad0db73
powerpc/perf: Add POWER9 alternate PM_RUN_CYC and PM_RUN_INST_CMPL events
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=20dd4c624d2515
powerpc/perf: Fix SDAR_MODE value for continous sampling on Power9
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=24bedcb7c81137
powerpc/perf: Fix branch event code for power9
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8c218578fcbbbd
powerpc/perf: Fix Power9 test_adder fields
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f2080b9ac3c45
powerpc/perf: Add Power8 mem_access event to sysfs
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d148c94c27a87
powerpc/perf: Support to export SIERs bit in Power9
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=453ce7a9432ee
powerpc/perf: Support to export SIERs bit in Power8
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=170a315f41c64
powerpc/perf: Support to export MMCRA[TEC*] field to userspace
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=79e96f8f930d4
powerpc/perf: Export memory hierarchy info to user space
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8c5073db0ee68
powerpc/perf: Define big-endian version of perf_mem_data_src

But this one is still in linux-next:

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=bdd21ddb919d28
powerpc/perf: Avoid spurious PMU interrupts after idle on Power9

Shriya / Madhavan,
Do you still expect that last one to be pulled in soon?

Changed in linux (Ubuntu Zesty):
status: Triaged → In Progress
assignee: nobody → Joseph Salisbury (jsalisbury)
Changed in linux (Ubuntu):
status: Triaged → In Progress
assignee: Canonical Kernel Team (canonical-kernel-team) → Joseph Salisbury (jsalisbury)
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

I built a Zesty test kernel with the sixteen patches mentioned in comment #5. The test kernel can be downloaded from:

http://kernel.ubuntu.com/~jsalisbury/lp1711104/

Can you test this kernel and see if it resolves this bug?

Thanks in advance!

Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2017-09-14 01:51 EDT-------
(In reply to comment #10)
> Looks like all but one of the patches are now in mainline:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/
> ?id=93fc5ca9a0048c
> powerpc/perf: Cleanup of PM_BR_CMPL vs. PM_BRU_CMPL in Power9 event list
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/
> ?id=91e0bd1e62519b
> powerpc/perf: Add PM_LD_MISS_L1 and PM_BR_2PATH to power9 event list
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/
> ?id=70a7e720998d5b
> powerpc/perf: Factor out PPMU_ONLY_COUNT_RUN check code from power8
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/
> ?id=7aa345d84245a7
> powerpc/perf: Update default sdar_mode value for power9
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/
> ?id=101dd590a7fa37
> powerpc/perf: Avoid spurious PMU interrupts after idle
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/
> ?id=3f0bd8dad0db73
> powerpc/perf: Add POWER9 alternate PM_RUN_CYC and PM_RUN_INST_CMPL events
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/
> ?id=20dd4c624d2515
> powerpc/perf: Fix SDAR_MODE value for continous sampling on Power9
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/
> ?id=24bedcb7c81137
> powerpc/perf: Fix branch event code for power9
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/
> ?id=8c218578fcbbbd
> powerpc/perf: Fix Power9 test_adder fields
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/
> ?id=f2080b9ac3c45
> powerpc/perf: Add Power8 mem_access event to sysfs
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/
> ?id=d148c94c27a87
> powerpc/perf: Support to export SIERs bit in Power9
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/
> ?id=453ce7a9432ee
> powerpc/perf: Support to export SIERs bit in Power8
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/
> ?id=170a315f41c64
> powerpc/perf: Support to export MMCRA[TEC*] field to userspace
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/
> ?id=79e96f8f930d4
> powerpc/perf: Export memory hierarchy info to user space
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/
> ?id=8c5073db0ee68
> powerpc/perf: Define big-endian version of perf_mem_data_src
>
>
> But this one is still in linux-next:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/
> ?id=bdd21ddb919d28
> powerpc/perf: Avoid spurious PMU interrupts after idle on Power9
>
> Shriya / Madhavan,
> Do you still expect that last one to be pulled in soon?

Looks like

https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=09539f9b123652e969894d6299ae0df2fe12cb5d

this is missing. Kindly can you pull this also.

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

The test kernel posted in comment #6 had the following commit from linux-next:

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=bdd21ddb919d28
powerpc/perf: Avoid spurious PMU interrupts after idle on Power9

That commit seems like it does the same thing as commit 09539f9, which you asked for in comment #7. Commit 09539f9 was added to mainline as of v4.13-rc4. Does that mean you no longer need commit bdd21ddb919d in linux-next?

Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2017-09-19 00:55 EDT-------
Yes commit bdd21ddb919d28 (-next) and 09539f9 (upstream) are same. Just wanted to confirm whether one of these is pulled into the ubuntu kernel (http://kernel.ubuntu.com/~jsalisbury/lp1711104/ ) or the in the latest kernel.

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Yes, that commit is in the test kernel posted at:
http://kernel.ubuntu.com/~jsalisbury/lp1711104/

Manoj Iyer (manjo)
tags: added: triage-g
removed: triage-a
Changed in ubuntu-power-systems:
status: Incomplete → In Progress
Changed in ubuntu-power-systems:
status: In Progress → Incomplete
Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2017-12-11 10:56 EDT-------
If we do not see any answer on this test for more than 1 week, let's reject it.

Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2017-12-13 13:32 EDT-------
(In reply to comment #17)
> Yes, that commit is in the test kernel posted at:
> http://kernel.ubuntu.com/~jsalisbury/lp1711104/

Tested the kernel given in the above link :

uname -a : Linux ltc-wspoon12 4.10.0-33-generic #37~lp1711104 SMP Wed Sep 13 19:55:56 UTC 2017 ppc64le ppc64le ppc64le GNU/Linux
Hardware : Witherspoon + DD2.1
FW : 1742Eg

root@ltc-wspoon12:~# cat /etc/os-release
NAME="Ubuntu"
VERSION="16.04.3 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.3 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial

Test results :
========
Testing looks good and results are as expected.

root@ltc-wspoon12:~# ./perf stat -e r4d05e -- sleep 1

Performance counter stats for 'sleep 1':

95,723 r4d05e

1.001016884 seconds time elapsed

root@ltc-wspoon12:~# ./perf stat -e r4d05e -- sleep 2

Performance counter stats for 'sleep 2':

95,859 r4d05e

2.000996600 seconds time elapsed

----------------

root@ltc-wspoon12:~# ./perf stat -e r3e054 -- sleep 3

Performance counter stats for 'sleep 3':

8,973 r3e054

3.001030248 seconds time elapsed

root@ltc-wspoon12:~# ./perf stat -e r400f0 -- sleep 3

Performance counter stats for 'sleep 3':

8,905 r400f0

3.000995167 seconds time elapsed

--------------

root@ltc-wspoon12:~# ./perf stat -e r200f4 -- sleep 3

Performance counter stats for 'sleep 3':

1,411,106 r200f4

3.000942725 seconds time elapsed

root@ltc-wspoon12:~# ^C
root@ltc-wspoon12:~# ./perf stat -e r400fa -- sleep 3

Performance counter stats for 'sleep 3':

544,977 r400fa

3.000928921 seconds time elapsed

------------------

root@ltc-wspoon12:~# ./perf stat -e r500fa -- sleep 3

Performance counter stats for 'sleep 3':

550,846 r500fa

3.000949027 seconds time elapsed

---------------------

root@ltc-wspoon12:~/ebizzy-0.3# ./perf record -e r67340101ea -d --weight ./ebizzy -m -n 100 -P -R -s 5120 -S 50 -t 3
^C[ perf record: Woken up 93 times to write data ]
[ perf record: Captured and wrote 24.162 MB perf.data (32508 samples) ]

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

The fix for this bug made it into Zesty via bug 1716491.

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Can you confirm that Zesty with the latest updates and at least the Ubuntu-4.10.0-38 resolves this bug?

no longer affects: perforate (Ubuntu Zesty)
Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2018-01-03 01:34 EDT-------
Tested on Ubuntu 16.04.03 , kernel : 4.10.0-43-generic
--------------------------------------------------------------------------------------
Hardware : P9 Witherspoon + DD2.1

Testing looks fine.

root@ltc-wspoon12:~# uname -a
Linux ltc-wspoon12 4.10.0-43-generic #47~16.04.1-Ubuntu SMP Wed Dec 13 19:21:53 UTC 2017 ppc64le ppc64le ppc64le GNU/Linux

Results :
=====
root@ltc-wspoon12:~# perf stat -e r4d05e -- sleep 1

Performance counter stats for 'sleep 1':

98,250 r4d05e

1.000861597 seconds time elapsed

root@ltc-wspoon12:~# perf stat -e r4d05e -- sleep 2

Performance counter stats for 'sleep 2':

98,603 r4d05e

2.000723944 seconds time elapsed

root@ltc-wspoon12:~# perf stat -e r3e054 -- sleep 3

Performance counter stats for 'sleep 3':

9,167 r3e054

3.000673888 seconds time elapsed

root@ltc-wspoon12:~# perf stat -e r400f0 -- sleep 3

Performance counter stats for 'sleep 3':

9,143 r400f0

3.000728772 seconds time elapsed

root@ltc-wspoon12:~# perf stat -e r200f4 -- sleep 3

Performance counter stats for 'sleep 3':

751,349 r200f4

3.000665969 seconds time elapsed

root@ltc-wspoon12:~# perf stat -e r400fa -- sleep 3

Performance counter stats for 'sleep 3':

563,389 r400fa

3.000760674 seconds time elapsed

root@ltc-wspoon12:~# perf stat -e r500fa -- sleep 3

Performance counter stats for 'sleep 3':

563,902 r500fa

3.000681230 seconds time elapsed

root@ltc-wspoon12:~# perf record -e r67340101ea ls
perf.data
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.006 MB perf.data (5 samples) ]

Changed in linux (Ubuntu Zesty):
status: In Progress → Fix Released
Changed in linux (Ubuntu):
status: In Progress → Fix Released
Manoj Iyer (manjo)
Changed in ubuntu-power-systems:
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.