[UBUNTU 20.04] Deflate counters reported by lscpumf are not valid or available with perf

Bug #1881096 reported by bugproxy
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu on IBM z Systems
Fix Released
Medium
Skipper Bug Screeners
linux (Ubuntu)
Fix Released
Undecided
Canonical Kernel Team
Focal
Fix Released
Undecided
Unassigned

Bug Description

SRU Justification:
==================

[Impact]

* With perf from Ubuntu 20.04 on IBM z15 hardware, some counters reported with lscpumf are not usable with 'perf stat -e'.

* 'lscpumf -c' provides a list of available counters, but the following are not usable: DFLT_ACCESS, DFLT_CYCLES, DFLT_CC, DFLT_CCERROR

* 'perf list' is also not offering these counters.

* On the kernel side this is fixed with the following upstream accepted commit:

[Fix]

* d68d5d51dc898895b4e15bea52e5668ca9e76180 d68d5d51dc898895b "s390/cpum_cf: Add new extended counters for IBM z15"

[Test Case]

* Requires the fix/patch of the perf tool, as mentioned in the bug, too.

* An IBM z15 (or LinuxONE III) system with Ubuntu 20.04 installed in LPAR is needed where the counters are enabled in the activation profile.

* Use 'perf list' to determine if the counters DFLT_ACCESS, DFLT_CYCLES, DFLT_CC, DFLT_CCERROR are listed

* Use 'perf stat -e' to enable amd make use of these counters.

[Regression Potential]

* The regression can be considered as low, since:

* it's architecture specific (s390x)

* limited to IBM z15 hardware

* and only additional (s390x) hardware counters are defined and added.

[Other]

* This requires a patch to be included into the perf itself, too - please see bug description for more details.

* Since this patch is upstream in kernel 5.7 it will automatically land in groovy.

__________

---Problem Description---
ubuntu 20.04: perf on z15: some counters reported with lscpumf are not usable with perf stat -e

---uname output---
Linux ubu204 5.4.0-26-generic #30-Ubuntu SMP Mon Apr 20 16:57:22 UTC 2020 s390x s390x s390x GNU/Linux

Machine Type = z15 8561

---Steps to Reproduce---
 lscpumf -c gives a list of available counters, but a few of them are not usable: DFLT_ACCESS,DFLT_CYCLES,DFLT_CC,DFLT_CCERROR
perf list is also not offering these counters.

A solution will be a backport to 20.04, and tried to made available for next SRU , code needed before 06-12.

Addl Info from Dev:
I have downloaded the following repository
https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/focal
and checked out branch master-next.

Both patches appended apply without warning and the compilation showed no error.

For the perf tool:
e7950166e40271c02 perf vendor events s390: Add new deflate counters for IBM z15

For the s390 kernel
d68d5d51dc898895b s390/cpum_cf: Add new extended counters for IBM z15

All accepted for kernel 5.7 rc1

Please include both patches into Ubuntu 20.04

Revision history for this message
bugproxy (bugproxy) wrote : s390/cpum_cf: Add new extended counters for IBM z15

Default Comment by Bridge

tags: added: architecture-s39064 bugnameltc-185899 severity-medium targetmilestone-inin2004
Revision history for this message
bugproxy (bugproxy) wrote : perf vendor events s390: Add new deflate counters for IBM z15

Default Comment by Bridge

Changed in ubuntu:
assignee: nobody → Skipper Bug Screeners (skipper-screen-team)
affects: ubuntu → linux (Ubuntu)
summary: - Deflate counters reported by lscpumf are not valid or available with
- perf
+ [UBUNTU 20.04] Deflate counters reported by lscpumf are not valid or
+ available with perf
Frank Heimes (fheimes)
Changed in ubuntu-z-systems:
assignee: nobody → Skipper Bug Screeners (skipper-screen-team)
Changed in linux (Ubuntu):
assignee: Skipper Bug Screeners (skipper-screen-team) → Canonical Kernel Team (canonical-kernel-team)
Changed in ubuntu-z-systems:
importance: Undecided → Medium
Revision history for this message
Frank Heimes (fheimes) wrote :

Kernel SRU request submitted:
https://lists.ubuntu.com/archives/kernel-team/2020-June/thread.html#111487
Updating status to 'In Progress'.

description: updated
Changed in linux (Ubuntu Focal):
status: New → In Progress
Changed in linux (Ubuntu):
status: New → In Progress
Changed in ubuntu-z-systems:
status: New → In Progress
Revision history for this message
Frank Heimes (fheimes) wrote :

But 'perf tool' patch (linux-tools-common, linux-tools-$(uname -r) ) still needed!

Revision history for this message
Sultan Alsawaf (kerneltoast) wrote :

perf tool patch submitted to the mailing list.

Changed in linux (Ubuntu Focal):
status: In Progress → Fix Committed
Frank Heimes (fheimes)
Changed in linux (Ubuntu):
status: In Progress → Fix Committed
Changed in ubuntu-z-systems:
status: In Progress → Fix Committed
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-focal' to 'verification-done-focal'. If the problem still exists, change the tag 'verification-needed-focal' to 'verification-failed-focal'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-focal
Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2020-08-11 06:49 EDT-------
I have installed this ubuntu version (adding focal-proposed to /etc/apt/list.sources.d tree):
root@t35lp46:~# uname -a
Linux t35lp46 5.4.0-43-generic #47-Ubuntu SMP Sat Aug 8 06:29:47 UTC 2020 s390x s390x s390x GNU/Linux
root@t35lp46:~#

root@t35lp46:~# ll /sys/devices/cpum_cf/events/DFLT_*
-r--r--r-- 1 root root 4096 Aug 11 10:41 /sys/devices/cpum_cf/events/DFLT_ACCESS
-r--r--r-- 1 root root 4096 Aug 11 10:41 /sys/devices/cpum_cf/events/DFLT_CC
-r--r--r-- 1 root root 4096 Aug 11 10:41 /sys/devices/cpum_cf/events/DFLT_CCERROR
-r--r--r-- 1 root root 4096 Aug 11 10:41 /sys/devices/cpum_cf/events/DFLT_CYCLES
root@t35lp46:~

The Deflate counters are listed and can be used:

root@t35lp46:~# perf stat -e cpum_cf/DFLT_CCERROR/ -- true

Performance counter stats for 'true':

0 cpum_cf/DFLT_CCERROR/

0.000379529 seconds time elapsed

0.000065000 seconds user
0.000193000 seconds sys

root@t35lp46:~#
The patches are verified ok

Revision history for this message
Frank Heimes (fheimes) wrote :

Thank you! Adjusted tags accordingly ...

tags: added: verification-done-focal
removed: verification-needed-focal
Revision history for this message
Frank Heimes (fheimes) wrote :

Kernel 5.8 migrated in between from groovy proposed to main,
hence updating the groovy part to Fix Released.

Changed in linux (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Frank Heimes (fheimes) wrote :

The fix landed in focal master with 'Ubuntu-5.4.0-43.47' and we are as of today at '5.4.0.45.49' in focal-updates, hence updating the focal entry of this ticket to Fix Released.

Changed in linux (Ubuntu):
status: Fix Committed → Fix Released
Changed in ubuntu-z-systems:
status: Fix Committed → Fix Released
Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2020-09-04 02:11 EDT-------
IBM Bugzilla status-> closed, Fix Released with focal

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.