Bug 207221
Summary: | kernel BUG at include/linux/swapops.h:197 | ||
---|---|---|---|
Product: | Memory Management | Reporter: | Erhard F. (erhard_f) |
Component: | Page Allocator | Assignee: | Andrew Morton (akpm) |
Status: | RESOLVED PATCH_ALREADY_AVAILABLE | ||
Severity: | normal | ||
Priority: | P1 | ||
Hardware: | PPC-32 | ||
OS: | Linux | ||
See Also: | https://bugzilla.kernel.org/show_bug.cgi?id=207873 | ||
Kernel Version: | 5.7-rc1 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
kernel dmesg (5.7-rc1, PowerMac G4 DP)
kernel .config (5.7-rc1, PowerMac G4 DP) kernel dmesg (5.7-rc5, PowerMac G4 DP) kernel .config (5.7-rc5, PowerMac G4 DP) kernel .config (5.7-rc6, PowerMac G4 DP) kernel dmesg (5.7-rc6, PowerMac G4 DP) screenshot of the spinlock issue transcript of the screenshot |
Created attachment 288409 [details]
kernel .config (5.7-rc1, PowerMac G4 DP)
# cat /proc/swaps Filename Type Size Used Priority /dev/zram0 partition 262140 0 16383 /dev/sda5 partition 16777212 0 -2 Well that's peculiar. Is it reproducible at all? Oops!...I Did It Again. ;) This time during kernel compilation. [...] [13321.920834] ------------[ cut here ]------------ [13321.925297] kernel BUG at include/linux/swapops.h:197! [13321.929594] Oops: Exception in kernel mode, sig: 5 [#2] [13321.933958] BE PAGE_SIZE=4K MMU=Hash SMP NR_CPUS=2 PowerMac [13321.938398] Modules linked in: auth_rpcgss nfsv4 dns_resolver nfs lockd grace sunrpc input_leds joydev b43legacy mac80211 hid_generic usbhid hid uas usb_storage cfg80211 snd_aoa_codec_tas snd_aoa_fabric_layout snd_aoa rfkill libarc4 evdev mac_hid therm_windtunnel firewire_ohci firewire_core sungem ohci_pci crc_itu_t sungem_phy sr_mod cdrom raid6_pq(+) zlib_inflate snd_aoa_i2sbus ohci_hcd ehci_pci snd_aoa_soundbus snd_pcm ssb ehci_hcd snd_timer pcmcia snd pcmcia_core soundcore usbcore uninorth_agp usb_common agpgart zstd zram zsmalloc [13321.956573] CPU: 0 PID: 22524 Comm: cc1 Tainted: G D W 5.7.0-rc1-PowerMacG4+ #1 [13321.962935] NIP: c02584b0 LR: c02584a4 CTR: 00000000 [13321.969298] REGS: f496bbc0 TRAP: 0700 Tainted: G D W (5.7.0-rc1-PowerMacG4+) [13321.975907] MSR: 00029032 <EE,ME,IR,DR,RI> CR: 28444448 XER: 00000000 [13321.982630] GPR00: c025849c f496bc78 ea7bde60 ef4a6988 00000000 00000003 c02584a4 00000001 GPR08: ef4a6988 00000001 00000000 f496bc78 28444448 1177d578 11770000 11777670 GPR16: 117761e8 11770540 0000000d e2b3b328 f496bdd4 ec792580 f496bdc8 e2b3b320 GPR24: fe92d795 7c0307d2 e2b3b320 ea7bde60 e2b3b300 ef4a6988 ec79255c ef4a6988 [13322.017947] NIP [c02584b0] __migration_entry_wait+0x94/0xf0 [13322.025355] LR [c02584a4] __migration_entry_wait+0x88/0xf0 [13322.032834] Call Trace: [13322.040275] [f496bc78] [c025849c] __migration_entry_wait+0x80/0xf0 (unreliable) [13322.048051] [f496bc98] [c021b8fc] do_swap_page+0xd4/0x7c4 [13322.055843] [f496bd58] [c021c764] handle_mm_fault+0x35c/0xb28 [13322.063696] [f496be68] [c002167c] do_page_fault+0x7ec/0x9d4 [13322.071594] [f496bf38] [c001a468] handle_page_fault+0x10/0x3c [13322.079551] --- interrupt: 301 at 0x1064ea00 LR = 0x1064e960 [13322.095466] Instruction dump: [13322.103450] 1fff0024 4bffd405 813d1c00 7fe9fa14 7fe3fb78 4bffe741 4bffe73d 7c7d1b78 [13322.111772] 4bffd3e9 813d0000 7d2948f8 552907fe <0f090000> 7fe3fb78 4bffec89 2c030000 [13322.120240] ---[ end trace 0d6e4219a059049c ]--- [13322.243489] ------------[ cut here ]------------ [13322.252181] kernel BUG at include/linux/swapops.h:197! [13322.260828] Oops: Exception in kernel mode, sig: 5 [#3] [13322.269531] BE PAGE_SIZE=4K MMU=Hash SMP NR_CPUS=2 PowerMac [13322.278321] Modules linked in: auth_rpcgss nfsv4 dns_resolver nfs lockd grace sunrpc input_leds joydev b43legacy mac80211 hid_generic usbhid hid uas usb_storage cfg80211 snd_aoa_codec_tas snd_aoa_fabric_layout snd_aoa rfkill libarc4 evdev mac_hid therm_windtunnel firewire_ohci firewire_core sungem ohci_pci crc_itu_t sungem_phy sr_mod cdrom raid6_pq(+) zlib_inflate snd_aoa_i2sbus ohci_hcd ehci_pci snd_aoa_soundbus snd_pcm ssb ehci_hcd snd_timer pcmcia snd pcmcia_core soundcore usbcore uninorth_agp usb_common agpgart zstd zram zsmalloc [13322.309506] CPU: 0 PID: 22368 Comm: cc1 Tainted: G D W 5.7.0-rc1-PowerMacG4+ #1 [13322.320217] NIP: c02584b0 LR: c02584a4 CTR: 00000000 [13322.330921] REGS: f480bbc0 TRAP: 0700 Tainted: G D W (5.7.0-rc1-PowerMacG4+) [13322.341880] MSR: 00029032 <EE,ME,IR,DR,RI> CR: 24044442 XER: 00000000 [13322.352957] GPR00: c025849c f480bc78 ed73a5c0 ef49e240 00000000 00000003 c02584a4 00000001 GPR08: ef49e240 00000001 00000000 f480bc78 24044442 1177d578 00000060 0fcd6a7c GPR16: 0000005e 00000001 00000000 eb8d1928 f480bdd4 ea721ec0 f480bdc8 eb8d1920 GPR24: fe901795 7c030410 eb8d1920 ed73a5c0 eb8d1900 ef49e240 ea721e9c ef49e240 [13322.409934] NIP [c02584b0] __migration_entry_wait+0x94/0xf0 [13322.421657] LR [c02584a4] __migration_entry_wait+0x88/0xf0 [13322.433439] Call Trace: [13322.445193] [f480bc78] [c025849c] __migration_entry_wait+0x80/0xf0 (unreliable) [13322.457284] [f480bc98] [c021b8fc] do_swap_page+0xd4/0x7c4 [13322.469379] [f480bd58] [c021c764] handle_mm_fault+0x35c/0xb28 [13322.481546] [f480be68] [c002167c] do_page_fault+0x7ec/0x9d4 [13322.493755] [f480bf38] [c001a468] handle_page_fault+0x10/0x3c [13322.506015] --- interrupt: 301 at 0xfb90bec LR = 0xfb90bd0 [13322.530543] Instruction dump: [13322.542821] 1fff0024 4bffd405 813d1c00 7fe9fa14 7fe3fb78 4bffe741 4bffe73d 7c7d1b78 [13322.555447] 4bffd3e9 813d0000 7d2948f8 552907fe <0f090000> 7fe3fb78 4bffec89 2c030000 [13322.568219] ---[ end trace 0d6e4219a059049d ]--- [13322.625968] ------------[ cut here ]------------ [13322.638972] kernel BUG at include/linux/swapops.h:197! [13322.651910] Oops: Exception in kernel mode, sig: 5 [#4] [13322.664919] BE PAGE_SIZE=4K MMU=Hash SMP NR_CPUS=2 PowerMac [13322.678013] Modules linked in: auth_rpcgss nfsv4 dns_resolver nfs lockd grace sunrpc input_leds joydev b43legacy mac80211 hid_generic usbhid hid uas usb_storage cfg80211 snd_aoa_codec_tas snd_aoa_fabric_layout snd_aoa rfkill libarc4 evdev mac_hid therm_windtunnel firewire_ohci firewire_core sungem ohci_pci crc_itu_t sungem_phy sr_mod cdrom raid6_pq(+) zlib_inflate snd_aoa_i2sbus ohci_hcd ehci_pci snd_aoa_soundbus snd_pcm ssb ehci_hcd snd_timer pcmcia snd pcmcia_core soundcore usbcore uninorth_agp usb_common agpgart zstd zram zsmalloc [13322.721746] CPU: 0 PID: 22511 Comm: cc1 Tainted: G D W 5.7.0-rc1-PowerMacG4+ #1 [13322.736485] NIP: c02584b0 LR: c02584a4 CTR: 00000000 [13322.750685] REGS: f493bbc0 TRAP: 0700 Tainted: G D W (5.7.0-rc1-PowerMacG4+) [13322.764564] MSR: 00029032 <EE,ME,IR,DR,RI> CR: 28044444 XER: 00000000 [13322.778012] GPR00: c025849c f493bc78 c41a0000 ef49e120 00000000 00000003 c02584a4 00000001 GPR08: ef49e120 00000001 00000000 f493bc78 28044444 1177d578 0000000d 11777670 GPR16: 11770000 00000125 00000125 ec75b428 f493bdd4 e7de2220 f493bdc8 ec75b420 GPR24: fe927795 7c030408 ec75b420 c41a0000 ec75b400 ef49e120 e7de21fc ef49e120 [13322.844865] NIP [c02584b0] __migration_entry_wait+0x94/0xf0 [13322.858174] LR [c02584a4] __migration_entry_wait+0x88/0xf0 [13322.871422] Call Trace: [13322.884545] [f493bc78] [c025849c] __migration_entry_wait+0x80/0xf0 (unreliable) [13322.897882] [f493bc98] [c021b8fc] do_swap_page+0xd4/0x7c4 [13322.911070] [f493bd58] [c021c764] handle_mm_fault+0x35c/0xb28 [13322.924242] [f493be68] [c002167c] do_page_fault+0x7ec/0x9d4 [13322.937374] [f493bf38] [c001a468] handle_page_fault+0x10/0x3c [13322.950426] --- interrupt: 301 at 0x105bf254 LR = 0x1070cba8 [13322.976307] Instruction dump: [13322.989194] 1fff0024 4bffd405 813d1c00 7fe9fa14 7fe3fb78 4bffe741 4bffe73d 7c7d1b78 [13323.002374] 4bffd3e9 813d0000 7d2948f8 552907fe <0f090000> 7fe3fb78 4bffec89 2c030000 [13323.015606] ---[ end trace 0d6e4219a059049e ]--- Created attachment 289097 [details]
kernel dmesg (5.7-rc5, PowerMac G4 DP)
Changed the swap setup to
zswap.enabled=1 zswap.max_pool_percent=13 zswap.zpool=z3fold zswap.compressor=zstd
Leaving out /dev/zram0 as a swap partotion with only
# cat /proc/swaps
Filename Type Size Used Priority
/dev/sda5 partition 16777212 0 -2
The issue stays however unchanged in 5.7-rc5:
[...]
[ 4366.625885] ------------[ cut here ]------------
[ 4366.631545] kernel BUG at include/linux/swapops.h:197!
[ 4366.636972] Oops: Exception in kernel mode, sig: 5 [#1]
[ 4366.642334] BE PAGE_SIZE=4K MMU=Hash SMP NR_CPUS=2 PowerMac
[ 4366.647614] Modules linked in: auth_rpcgss nfsv4 dns_resolver nfs lockd grace sunrpc input_leds joydev b43legacy mac80211 hid_generic usbhid uas cfg80211 hid usb_storage snd_aoa_codec_tas snd_aoa_fabric_layout snd_aoa rfkill libarc4 evdev mac_hid therm_windtunnel firewire_ohci sungem sungem_phy firewire_core crc_itu_t ohci_pci btrfs xor zlib_deflate raid6_pq zlib_inflate snd_aoa_i2sbus snd_aoa_soundbus sr_mod snd_pcm cdrom ehci_pci ohci_hcd snd_timer ehci_hcd snd soundcore ssb pcmcia usbcore pcmcia_core uninorth_agp usb_common agpgart
[ 4366.667221] CPU: 1 PID: 13049 Comm: emerge Tainted: G W 5.7.0-rc5-PowerMacG4+ #2
[ 4366.673910] NIP: c04a5bc0 LR: c04a5b74 CTR: 00000000
[ 4366.680619] REGS: f357bb80 TRAP: 0700 Tainted: G W (5.7.0-rc5-PowerMacG4+)
[ 4366.687483] MSR: 00029032 <EE,ME,IR,DR,RI> CR: 24444440 XER: 00000000
[ 4366.694407]
GPR00: c04a5b74 f357bc38 e28538a0 ef9d1e2c 00000000 00000000 00000000 00000001
GPR08: 00000007 00000001 00000000 f357bc38 24444440 006d8ff4 b43c1d2c e77e0060
GPR16: 1e6af7b4 e77e0000 1e6af7f9 f357bda4 00000000 e97d3da8 fe6af78f e28538a0
GPR24: 780553f3 f357bd98 fd2fa7b4 e97d3da0 e97d3d80 ef9d1e2c e77e003c ef9d1e2c
[ 4366.730097] NIP [c04a5bc0] __migration_entry_wait+0x13c/0x198
[ 4366.737462] LR [c04a5b74] __migration_entry_wait+0xf0/0x198
[ 4366.744859] Call Trace:
[ 4366.752225] [f357bc38] [c04a5b74] __migration_entry_wait+0xf0/0x198 (unreliable)
[ 4366.759933] [f357bc58] [c042bdc4] do_swap_page+0x1f0/0x143c
[ 4366.767650] [f357bd28] [c042e4b8] handle_mm_fault+0x794/0x16f4
[ 4366.775441] [f357be48] [c0039868] do_page_fault+0xf50/0x12f8
[ 4366.783270] [f357bf38] [c002c468] handle_page_fault+0x10/0x3c
[ 4366.791022] --- interrupt: 301 at 0x3f78a8
LR = 0x3f75a4
[ 4366.806285] Instruction dump:
[ 4366.813944] 5529cffe 7d0a4010 7d290194 5529063e 2c090000 41820010 2c0a0000 41a20008
[ 4366.821930] 4bffbbe5 813d0000 7d2948f8 552907fe <0f090000> 7fe3fb78 4bffd6e1 2c030000
[ 4366.830031] ---[ end trace 54a4e570cce5564b ]---
Created attachment 289099 [details]
kernel .config (5.7-rc5, PowerMac G4 DP)
Found a quick and reliable way to trigger this bug on my machine. # git clone https://github.com/kdave/btrfs-progs && cd btrfs-progs/ # ./autogen.sh && ./configure --disable-documentation # make && make fssum # cd tests/ # TEST=013\* ./misc-tests.sh The bug is followed by a do_raw_spin_lock issue which I can't get via ssh (so unfortunately screenshot only). Also it seems ppc-specific. I was not able to trigger the bug on my Pentium4 x86 box with similar kernel .config. Created attachment 289207 [details]
kernel .config (5.7-rc6, PowerMac G4 DP)
Created attachment 289209 [details]
kernel dmesg (5.7-rc6, PowerMac G4 DP)
Created attachment 289211 [details]
screenshot of the spinlock issue
Created attachment 289249 [details]
transcript of the screenshot
The following commit fixes the issue: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=40bb0e904212cf7d6f041a98c58c8341b2016670 The btrfs test suite completes fine now and building larger projects works unremarkably. Will close here as the fix seems to be going into -rc7. |
Created attachment 288407 [details] kernel dmesg (5.7-rc1, PowerMac G4 DP) Happened during building gtk+-3.24.16. [...] [ 5242.264118] ------------[ cut here ]------------ [ 5242.270319] kernel BUG at include/linux/swapops.h:197! [ 5242.276370] Oops: Exception in kernel mode, sig: 5 [#1] [ 5242.282425] BE PAGE_SIZE=4K MMU=Hash SMP NR_CPUS=2 PowerMac [ 5242.288524] Modules linked in: auth_rpcgss nfsv4 dns_resolver nfs lockd grace sunrpc b43legacy mac80211 input_leds joydev hid_generic usbhid cfg80211 hid uas usb_storage snd_aoa_codec_tas snd_aoa_fabric_layout snd_aoa rfkill libarc4 evdev mac_hid therm_windtunnel sungem sungem_phy btrfs ohci_pci xor lzo_compress lzo_decompress zlib_deflate raid6_pq zlib_inflate firewire_ohci firewire_core crc_itu_t sr_mod snd_aoa_i2sbus ohci_hcd ehci_pci snd_aoa_soundbus cdrom snd_pcm ehci_hcd snd_timer snd ssb soundcore usbcore pcmcia uninorth_agp pcmcia_core agpgart usb_common zstd zram zsmalloc [ 5242.311659] CPU: 1 PID: 18603 Comm: cc1 Tainted: G W 5.7.0-rc1-PowerMacG4+ #10 [ 5242.319678] NIP: c0499398 LR: c049934c CTR: 00000000 [ 5242.327683] REGS: f5523b90 TRAP: 0700 Tainted: G W (5.7.0-rc1-PowerMacG4+) [ 5242.335779] MSR: 00029032 <EE,ME,IR,DR,RI> CR: 22244422 XER: 00000000 [ 5242.343851] GPR00: c049934c f5523c48 c55638a0 ef4e36a8 00000000 00000000 00000000 00000001 GPR08: 00000003 00000001 00000000 f5523c48 22244422 1177d578 11780000 e73fa220 GPR16: 1eaa47b6 e73fa1c0 1eaa47f9 f5523db4 00000000 d172cc28 feaa4791 c55638a0 GPR24: 780322da f5523da8 fa2e5984 d172cc20 d172cc00 ef4e36a8 e73fa1fc ef4e36a8 [ 5242.384606] NIP [c0499398] __migration_entry_wait+0x13c/0x198 [ 5242.392947] LR [c049934c] __migration_entry_wait+0xf0/0x198 [ 5242.401261] Call Trace: [ 5242.409385] [f5523c48] [c049934c] __migration_entry_wait+0xf0/0x198 (unreliable) [ 5242.417659] [f5523c68] [c0425118] do_swap_page+0x1f0/0x143c [ 5242.425866] [f5523d38] [c042780c] handle_mm_fault+0x794/0x16f4 [ 5242.434174] [f5523e58] [c0039820] do_page_fault+0xf08/0x12b0 [ 5242.442462] [f5523f38] [c002c468] handle_page_fault+0x10/0x3c [ 5242.450805] --- interrupt: 401 at 0x10699b54 LR = 0x10703834 [ 5242.467483] Instruction dump: [ 5242.475848] 5529cffe 7d0a4010 7d290194 5529063e 2c090000 41820010 2c0a0000 41a20008 [ 5242.484549] 4bffbbe5 813d0000 7d2948f8 552907fe <0f090000> 7fe3fb78 4bffd6e1 2c030000 [ 5242.493356] ---[ end trace 331c0422c6c647aa ]--- [ 5242.528028] ------------[ cut here ]------------ [ 5242.536997] kernel BUG at include/linux/swapops.h:197! [ 5242.545880] Oops: Exception in kernel mode, sig: 5 [#2] [ 5242.554848] BE PAGE_SIZE=4K MMU=Hash SMP NR_CPUS=2 PowerMac [ 5242.563840] Modules linked in: auth_rpcgss nfsv4 dns_resolver nfs lockd grace sunrpc b43legacy mac80211 input_leds joydev hid_generic usbhid cfg80211 hid uas usb_storage snd_aoa_codec_tas snd_aoa_fabric_layout snd_aoa rfkill libarc4 evdev mac_hid therm_windtunnel sungem sungem_phy btrfs ohci_pci xor lzo_compress lzo_decompress zlib_deflate raid6_pq zlib_inflate firewire_ohci firewire_core crc_itu_t sr_mod snd_aoa_i2sbus ohci_hcd ehci_pci snd_aoa_soundbus cdrom snd_pcm ehci_hcd snd_timer snd ssb soundcore usbcore pcmcia uninorth_agp pcmcia_core agpgart usb_common zstd zram zsmalloc [ 5242.595192] CPU: 1 PID: 18593 Comm: cc1 Tainted: G D W 5.7.0-rc1-PowerMacG4+ #10 [ 5242.605917] NIP: c0499398 LR: c049934c CTR: 00000000 [ 5242.616595] REGS: f54f3b90 TRAP: 0700 Tainted: G D W (5.7.0-rc1-PowerMacG4+) [ 5242.627516] MSR: 00029032 <EE,ME,IR,DR,RI> CR: 22244424 XER: 00000000 [ 5242.638554] GPR00: c049934c f54f3c48 c3ab0000 ef4e36a8 00000000 00000000 00000000 00000001 GPR08: 00000003 00000001 00000000 f54f3c48 22244424 1177d578 11780000 d9a414a0 GPR16: 1ea9e7b6 d9a41440 1ea9e7f9 f54f3db4 00000000 d142e7a8 fea9e791 c3ab0000 GPR24: 780322da f54f3da8 fa285cf4 d142e7a0 d142e780 ef4e36a8 d9a4147c ef4e36a8 [ 5242.695282] NIP [c0499398] __migration_entry_wait+0x13c/0x198 [ 5242.706992] LR [c049934c] __migration_entry_wait+0xf0/0x198 [ 5242.718642] Call Trace: [ 5242.730298] [f54f3c48] [c049934c] __migration_entry_wait+0xf0/0x198 (unreliable) [ 5242.742332] [f54f3c68] [c0425118] do_swap_page+0x1f0/0x143c [ 5242.754423] [f54f3d38] [c042780c] handle_mm_fault+0x794/0x16f4 [ 5242.766620] [f54f3e58] [c0039820] do_page_fault+0xf08/0x12b0 [ 5242.778897] [f54f3f38] [c002c468] handle_page_fault+0x10/0x3c [ 5242.791267] --- interrupt: 401 at 0x10699b54 LR = 0x10703680 [ 5242.815964] Instruction dump: [ 5242.828286] 5529cffe 7d0a4010 7d290194 5529063e 2c090000 41820010 2c0a0000 41a20008 [ 5242.840943] 4bffbbe5 813d0000 7d2948f8 552907fe <0f090000> 7fe3fb78 4bffd6e1 2c030000 [ 5242.853704] ---[ end trace 331c0422c6c647ab ]---