[UBUNTU 20.04] rcu stalls with many storage key guests

Bug #1975582 reported by bugproxy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu on IBM z Systems
Fix Released
Medium
Skipper Bug Screeners
linux (Ubuntu)
Invalid
Medium
Skipper Bug Screeners
Focal
Fix Released
Medium
Canonical Kernel Team
Impish
Won't Fix
Medium
Canonical Kernel Team
Jammy
Fix Released
Medium
Canonical Kernel Team

Bug Description

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

[Impact]

 * Ubuntu on s390x KVM environments with lots of large guests with storage
   keys can be affected by rcu stalls.

 * These rcu stalls can cause the system to crash/dump.

[Fix]

 * 3ae11dbcfac9 3ae11dbcfac906a8c3a480e98660a823130dc16a "s390/mm: use non-quiescing sske for KVM switch to keyed guest"

 * 6d5946274df1 6d5946274df1fff539a7eece458a43be733d1db8 "s390/gmap: voluntarily schedule during key setting"

[Test Plan]

 * There is no trigger or direct test or re-creation of the
   problem situation possible, but...

 * and IBM z13 or LinuxONE (or never) LPAR is needed that
   runs Ubuntu Server 20.04 LTS or 18.04 LTS with HWE kernel
   and acts as KVM host with again several large guests running
   on top with storage groups.

 * Let such a system running for days under significant load
   and watch the logs for rcu issues.

 * Prior to the submission of this SRU patched test kernels
   for focal 5.4 and bionic hwe-5.4 were created and tested.
   They ran for days at a staging environemnt at IBM
   without further issues.

 * The modifications are all limited to s390x.

 * A test kernel was build (see below) that ran in a test environment
   at IBM under appropriate load for several days.

[Where problems could occur]

 * Due to the change for the KVM switch to keyed guest
   from classic sske to non-quiescing sske
   the KVM behaviour might have changed and the storage keys harmed.

 * The now more generous scheduling while setting keys
   has an impact on the guest memory management and mapping
   which will lead to a different performance.

 * This, with the introduction of __s390_enable_skey_pmd and
   cond_resched, might increase the overhead in certain situations,
   but eventually improves the responsiveness over time,
   hence avoid rcu stalls.

[Other Info]

 * Since the patches are upstream in 5.19-rc1,
   they will be included in the kernel that is planned for kinetic (5.19).

 * Hence this is an SRU to jammy, impish and focal.

__________

---Problem Description---
There can be rcu stalls when running lots of large guests with storage keys:

[1377614.579833] rcu: INFO: rcu_sched self-detected stall on CPU
[1377614.579845] rcu: 18-....: (2099 ticks this GP) idle=54e/1/0x4000000000000002 softirq=35598716/35598716 fqs=998
[1377614.579895] (t=2100 jiffies g=155867385 q=20879)
[1377614.579898] Task dump for CPU 18:
[1377614.579899] CPU 1/KVM R running task 0 1030947 256019 0x06000004
[1377614.579902] Call Trace:
[1377614.579912] ([<0000001f1f4b4f52>] show_stack+0x7a/0xc0)
[1377614.579918] [<0000001f1ec8e96c>] sched_show_task.part.0+0xdc/0x100
[1377614.579919] [<0000001f1f4b7248>] rcu_dump_cpu_stacks+0xc0/0x100
[1377614.579924] [<0000001f1ecdd10c>] rcu_sched_clock_irq+0x75c/0x980
[1377614.579926] [<0000001f1eceb26c>] update_process_times+0x3c/0x80
[1377614.579931] [<0000001f1ecfcfea>] tick_sched_handle.isra.0+0x4a/0x70
[1377614.579932] [<0000001f1ecfd28e>] tick_sched_timer+0x5e/0xc0
[1377614.579933] [<0000001f1ecec294>] __hrtimer_run_queues+0x114/0x2f0
[1377614.579935] [<0000001f1ececfdc>] hrtimer_interrupt+0x12c/0x2a0
[1377614.579938] [<0000001f1ebecb6a>] do_IRQ+0xaa/0xb0
[1377614.579942] [<0000001f1f4c6d08>] ext_int_handler+0x130/0x134
[1377614.579945] [<0000001f1ec0af10>] ptep_zap_key+0x40/0x60

Contact Information = <email address hidden>

---uname output---
     RELEASE: 5.4.0-90-generic
     VERSION: #101-Ubuntu SMP Fri Oct 15 19:59:45 UTC 2021

== Comment: #1 - Christian Borntraeger <email address hidden> - 2022-05-24 03:59:37 ==
This is a test patch that might address the rcu stalls.

== Comment: #2 - Christian Borntraeger <email address hidden> - 2022-05-24 04:00:22 ==
This is a 2nd patch that reduces the cost of key setting.

CVE References

Revision history for this message
bugproxy (bugproxy) wrote : patch that adds scheduling points

Default Comment by Bridge

tags: added: architecture-s39064 bugnameltc-198360 severity-medium targetmilestone-inin---
Revision history for this message
bugproxy (bugproxy) wrote : patch that uses cheaper key setting variant

Default Comment by Bridge

Changed in ubuntu:
assignee: nobody → Skipper Bug Screeners (skipper-screen-team)
affects: ubuntu → linux (Ubuntu)
Frank Heimes (fheimes)
Changed in ubuntu-z-systems:
importance: Undecided → Medium
Changed in linux (Ubuntu):
importance: Undecided → Medium
Changed in ubuntu-z-systems:
assignee: nobody → Skipper Bug Screeners (skipper-screen-team)
Revision history for this message
Frank Heimes (fheimes) wrote (last edit ):

Hi, I have some questions on these patches:
Looks to me that these are not upstream, yet?
At least I couldn't find them in 'linux-next' (nor in some staging trees I'm aware of).
We actually would need to have them upstream accepted first, before we can pick them up.
Is it planned to get them upstream accepted? And if so with which kernel version?
And would it make sense tagging these as stable updates?

Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

At least I couldn't find them in 'linux-next'.
We actually would need to have them upstream first, before we can pick them up.

------- Comment From <email address hidden> 2022-05-24 07:14 EDT-------
(In reply to comment #9)
> Hi, I have some questions on these patches:
> Looks to me that these are not upstream, yet?
> At least I couldn't find them in 'linux-next'.
> We actually would need to have them upstream first, before we can pick them
> up.
> Is it planned to get them upstream accepted? And if so with which kernel
> version?
> And would it make sense tagging these as stable updates?

Not upstream yet and not yet queued. I wrote these patches after looking at the symptoms. My idea was to let you build a test ppa with these patches to verify that they really fix the issue. I will then queue them upstream.

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

Okay, happy to do that.
I'll kick off a test build in PPA soon.
Will do focal 5.4 and bionic hwe-5.4.

Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2022-05-24 07:34 EDT-------
@ Frank: as already mentioned via slack please build a test ppa with these 2 attached patches, including / on top of the another 2 fixes from bug 198271 / launchpad LP#1974017
Thanks a lot.

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

A focal 5.4 and a bionic hwe-5.4 kernel are now build for testing at PPA:
https://launchpad.net/~fheimes/+archive/ubuntu/lp1975582
respectively:
https://launchpad.net/~fheimes/+archive/ubuntu/lp1975582/+packages

They both include (top-most commits):
"s390/pgtable: use non-quiescing sske for KVM switch to keyed"
"s390/gmap: voluntarily schedule during key setting"
"KVM: s390: vsie/gmap: reduce gmap_rmap overhead"
"NFS: Fix up nfs_ctx_key_to_expire()"

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

Another issue was just reported which looks very similar: LP#1977837
I asked to re-try the cert. suite with the same test kernel that was build for this ticket.

Frank Heimes (fheimes)
Changed in linux (Ubuntu):
status: In Progress → Invalid
Changed in linux (Ubuntu Focal):
status: New → In Progress
Changed in linux (Ubuntu Impish):
status: New → In Progress
Changed in linux (Ubuntu Jammy):
status: New → In Progress
description: updated
Changed in linux (Ubuntu Focal):
importance: Undecided → Medium
Changed in linux (Ubuntu Impish):
importance: Undecided → Medium
Changed in linux (Ubuntu Jammy):
importance: Undecided → Medium
Changed in linux (Ubuntu Focal):
assignee: nobody → Canonical Kernel Team (canonical-kernel-team)
Changed in linux (Ubuntu Impish):
assignee: nobody → Canonical Kernel Team (canonical-kernel-team)
Changed in linux (Ubuntu Jammy):
assignee: nobody → Canonical Kernel Team (canonical-kernel-team)
Revision history for this message
Frank Heimes (fheimes) wrote :

SRU request submitted to the Ubuntu kernel team mailing list for jammy, impish and focal:
https://lists.ubuntu.com/archives/kernel-team/2022-June/thread.html#130934
Changing status to 'In Progress' for jammy, impish and focal.

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

Added test builds for Impish and Jammy on top of the focal ones:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1975582

Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2022-06-20 04:34 EDT-------
One patch was picked by the stable team:

Patch "s390/gmap: voluntarily schedule during key setting" has been added to the 5.18-stable tree

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

Ok, thx for the info.
I've arranged to get in both and submitted the request to the kernel teams mailing list.
(Thekernel team will notice that one is now stable and get it via that way ...)

Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2022-06-20 04:51 EDT-------
(In reply to comment #16)
> Another issue was just reported which looks very similar: LP#1977837
> I asked to re-try the cert. suite with the same test kernel that was build
> for this ticket.

I would think that this is a different bug (no KVM involved in 1977837 as far as I can see).

Stefan Bader (smb)
Changed in linux (Ubuntu Jammy):
status: In Progress → Fix Committed
Changed in linux (Ubuntu Impish):
status: In Progress → Fix Committed
Changed in linux (Ubuntu Focal):
status: In Progress → Fix Committed
Frank Heimes (fheimes)
Changed in ubuntu-z-systems:
status: In Progress → Fix Committed
Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2022-06-23 11:33 EDT-------
I asked the stable team to also pick the other patch.

https://lore.kernel.org/linux-s390/20220623151520.73354-1-
<email address hidden>/T/#u

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

Perfect, thank you!

Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the linux/5.15.0-41.44 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-jammy' to 'verification-done-jammy'. If the problem still exists, change the tag 'verification-needed-jammy' to 'verification-failed-jammy'.

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-jammy
tags: added: verification-needed-focal
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the linux/5.4.0-122.138 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!

bugproxy (bugproxy)
tags: added: targetmilestone-inin2004
removed: targetmilestone-inin---
bugproxy (bugproxy)
tags: added: verification-done-focal verification-done-jammy
removed: verification-needed-focal verification-needed-jammy
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (14.2 KiB)

This bug was fixed in the package linux - 5.4.0-122.138

---------------
linux (5.4.0-122.138) focal; urgency=medium

  * focal/linux: 5.4.0-122.138 -proposed tracker (LP: #1979489)

  * Remove SAUCE patches from test_vxlan_under_vrf.sh in net of
    ubuntu_kernel_selftests (LP: #1975691)
    - Revert "UBUNTU: SAUCE: selftests: net: Don't fail test_vxlan_under_vrf on
      xfail"
    - Revert "UBUNTU: SAUCE: selftests: net: Make test for VXLAN underlay in non-
      default VRF an expected failure"

  * Enable Asus USB-BT500 Bluetooth dongle(0b05:190e) (LP: #1976613)
    - Bluetooth: btusb: Add flag to define wideband speech capability
    - Bluetooth: btrtl: Add support for RTL8761B
    - Bluetooth: btusb: Add 0x0b05:0x190e Realtek 8761BU (ASUS BT500) device.

  * [UBUNTU 20.04] rcu stalls with many storage key guests (LP: #1975582)
    - s390/gmap: voluntarily schedule during key setting
    - s390/mm: use non-quiescing sske for KVM switch to keyed guest

  * Ubuntu 5.4.0-117.132-generic 5.4.189 has BUG: kernel NULL pointer
    dereference, address: 0000000000000034 (LP: #1978719)
    - mm: rmap: explicitly reset vma->anon_vma in unlink_anon_vmas()

  * Focal update: upstream stable patchset v5.4.192 (LP: #1979014)
    - floppy: disable FDRAWCMD by default
    - [Config] updateconfigs for BLK_DEV_FD_RAWCMD
    - hamradio: defer 6pack kfree after unregister_netdev
    - hamradio: remove needs_free_netdev to avoid UAF
    - lightnvm: disable the subsystem
    - [Config] updateconfigs for NVM, NVM_PBLK
    - usb: mtu3: fix USB 3.0 dual-role-switch from device to host
    - USB: quirks: add a Realtek card reader
    - USB: quirks: add STRING quirk for VCOM device
    - USB: serial: whiteheat: fix heap overflow in WHITEHEAT_GET_DTR_RTS
    - USB: serial: cp210x: add PIDs for Kamstrup USB Meter Reader
    - USB: serial: option: add support for Cinterion MV32-WA/MV32-WB
    - USB: serial: option: add Telit 0x1057, 0x1058, 0x1075 compositions
    - xhci: stop polling roothubs after shutdown
    - xhci: increase usb U3 -> U0 link resume timeout from 100ms to 500ms
    - iio: dac: ad5592r: Fix the missing return value.
    - iio: dac: ad5446: Fix read_raw not returning set value
    - iio: magnetometer: ak8975: Fix the error handling in ak8975_power_on()
    - usb: misc: fix improper handling of refcount in uss720_probe()
    - usb: typec: ucsi: Fix role swapping
    - usb: gadget: uvc: Fix crash when encoding data for usb request
    - usb: gadget: configfs: clear deactivation flag in
      configfs_composite_unbind()
    - usb: dwc3: core: Fix tx/rx threshold settings
    - usb: dwc3: gadget: Return proper request status
    - serial: imx: fix overrun interrupts in DMA mode
    - serial: 8250: Also set sticky MCR bits in console restoration
    - serial: 8250: Correct the clock for EndRun PTP/1588 PCIe device
    - arch_topology: Do not set llc_sibling if llc_id is invalid
    - hex2bin: make the function hex_to_bin constant-time
    - hex2bin: fix access beyond string end
    - video: fbdev: udlfb: properly check endpoint type
    - arm64: dts: meson: remove CPU opps below 1GHz for G12B boards
    - arm64: dts: meson: remove CPU opps below 1GHz fo...

Changed in linux (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (31.7 KiB)

This bug was fixed in the package linux - 5.15.0-41.44

---------------
linux (5.15.0-41.44) jammy; urgency=medium

  * jammy/linux: 5.15.0-41.44 -proposed tracker (LP: #1979448)

  * Fix can't boot up after change to vmd (LP: #1976587)
    - PCI: vmd: Assign VMD IRQ domain before enumeration
    - PCI: vmd: Revert 2565e5b69c44 ("PCI: vmd: Do not disable MSI-X remapping if
      interrupt remapping is enabled by IOMMU.")

  * [SRU][Jammy/OEM-5.17][PATCH 0/1] Fix calltrace in mac80211 (LP: #1978297)
    - mac80211: fix struct ieee80211_tx_info size

  * [SRU][Jammy][PATCH 0/1] Fix amd display corruption on s2idle resume
    (LP: #1978244)
    - drm/amd/display: Don't reinitialize DMCUB on s0ix resume

  * pl2303 serial adapter not recognized (LP: #1967493)
    - USB: serial: pl2303: fix type detection for odd device

  * Remove SAUCE patches from test_vxlan_under_vrf.sh in net of
    ubuntu_kernel_selftests (LP: #1975691)
    - Revert "UBUNTU: SAUCE: selftests: net: Don't fail test_vxlan_under_vrf on
      xfail"
    - Revert "UBUNTU: SAUCE: selftests: net: Make test for VXLAN underlay in non-
      default VRF an expected failure"

  * Fix hp_wmi_read_int() reporting error (0x05) (LP: #1979051)
    - platform/x86: hp-wmi: Fix hp_wmi_read_int() reporting error (0x05)

  * Request to back port vmci patches to Ubuntu kernel (LP: #1978145)
    - VMCI: dma dg: whitespace formatting change for vmci register defines
    - VMCI: dma dg: add MMIO access to registers
    - VMCI: dma dg: detect DMA datagram capability
    - VMCI: dma dg: set OS page size
    - VMCI: dma dg: register dummy IRQ handlers for DMA datagrams
    - VMCI: dma dg: allocate send and receive buffers for DMA datagrams
    - VMCI: dma dg: add support for DMA datagrams sends
    - VMCI: dma dg: add support for DMA datagrams receive
    - VMCI: Fix some error handling paths in vmci_guest_probe_device()
    - VMCI: Release notification_bitmap in error path
    - VMCI: Check exclusive_vectors when freeing interrupt 1
    - VMCI: Add support for ARM64
    - [Config] Update policies for VMWARE_VMCI and VMWARE_VMCI_VSOCKETS

  * [UBUNTU 20.04] rcu stalls with many storage key guests (LP: #1975582)
    - s390/gmap: voluntarily schedule during key setting
    - s390/mm: use non-quiescing sske for KVM switch to keyed guest

  * [SRU][OEM-5.14/OEM-5.17/Jammy][PATCH 0/1] Fix i915 calltrace on new ADL BIOS
    (LP: #1976214)
    - drm/i915: update new TMDS clock setting defined by VBT

  * Revert PPC get_user workaround (LP: #1976248)
    - powerpc: Export mmu_feature_keys[] as non-GPL

  * Jammy update: v5.15.39 upstream stable release (LP: #1978240)
    - MIPS: Fix CP0 counter erratum detection for R4k CPUs
    - parisc: Merge model and model name into one line in /proc/cpuinfo
    - ALSA: hda/realtek: Add quirk for Yoga Duet 7 13ITL6 speakers
    - ALSA: fireworks: fix wrong return count shorter than expected by 4 bytes
    - mmc: sdhci-msm: Reset GCC_SDCC_BCR register for SDHC
    - mmc: sunxi-mmc: Fix DMA descriptors allocated above 32 bits
    - mmc: core: Set HS clock speed before sending HS CMD13
    - gpiolib: of: fix bounds check for 'gpio-reserved-ranges'
    - x86/fpu: Prevent FPU s...

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

Since Impish with reach it's EOL this week on July the 14th,
I'll change Impish here also to Won't Fix
that allows to close this bug entirely.

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

------- Comment From <email address hidden> 2022-07-11 11:05 EDT-------
With this fix being released to -updates, I am closing the bug.
Thanks to everyone for your work on this.

Changing Bugzilla status to: CLOSED

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.