On Sun, Aug 25, 2024 at 07:55:36AM GMT, Piotr Oniszczuk wrote: > > > > Wiadomość napisana przez Nhat Pham <nphamcs@xxxxxxxxx> w dniu 23.08.2024, o godz. 18:16: > > > > > > Have you tried with 6.9 yet? IIRC, there are two major changes to > > zswap architecture in recent versions. > > > > 1. In 6.9, we range-partition zswap's rbtrees to reduce lock contention. > > > > Ok - after 32h of continuous compilation also on 6.9.12 I got series of oops (see below). > Since you have a reliable-ish repro: Could you compile a KASAN kernel and run that? Note that KASAN has a very real performance hit (if you're using this for prod) but it'll probably help shake out the bug. > [68616.350398] watchdog: BUG: soft lockup - CPU#4 stuck for 596s! [kcompactd0:176] <snip> > [68616.350490] ? hrtimer_interrupt+0xfa/0x230 > [68616.350492] ? __sysvec_apic_timer_interrupt+0x55/0x150 > [68616.350494] ? sysvec_apic_timer_interrupt+0x6c/0x90 > [68616.350497] </IRQ> > [68616.350498] <TASK> > [68616.350500] ? asm_sysvec_apic_timer_interrupt+0x1a/0x20 > [68616.350503] ? native_queued_spin_lock_slowpath+0x6e/0x2e0 > [68616.350506] _raw_spin_lock+0x29/0x30 > [68616.350509] page_vma_mapped_walk+0x6a2/0x950 I don't understand what this is spinning on here. Page table lock? Could you get the file/line number from this address? > [68616.350511] try_to_migrate_one+0x174/0xbf0 > [68616.350515] rmap_walk_anon+0xb6/0x190 > [68616.350518] try_to_migrate+0xf9/0x110 > [68616.350520] ? __pfx_try_to_migrate_one+0x10/0x10 > [68616.350523] ? __pfx_folio_not_mapped+0x10/0x10 > [68616.350526] ? __pfx_folio_lock_anon_vma_read+0x10/0x10 > [68616.350528] ? __pfx_invalid_migration_vma+0x10/0x10 > [68616.350531] migrate_pages_batch+0x545/0xb80 > [68616.350534] ? __pfx_compaction_free+0x10/0x10 > [68616.350536] ? __pfx_compaction_alloc+0x10/0x10 > [68616.350540] ? __pfx_remove_migration_pte+0x10/0x10 > [68616.350542] migrate_pages+0xada/0xd90 > [68616.350545] ? __pfx_compaction_alloc+0x10/0x10 > [68616.350548] ? __pfx_compaction_free+0x10/0x10 > [68616.350551] ? folio_add_lru+0x5f/0xb0 > [68616.350553] compact_zone+0x9e8/0x10c0 <snip> > [68620.214430] RSP: 0000:ffffb2688397fbe0 EFLAGS: 00000202 > [68620.214432] RAX: 00000000000c0101 RBX: ffff9388140cf738 RCX: 0000000000000008 > [68620.214434] RDX: 0000000000000000 RSI: 0000000000000101 RDI: ffff9388140cf738 > [68620.214436] RBP: ffff938b2e6373c0 R08: ffff938b2e6310c0 R09: 000000000000000a > [68620.214438] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000040000 > [68620.214440] R13: 0000000000040000 R14: ffff9388140cf738 R15: ffff9388140cf730 > [68620.214442] FS: 00007fc78bf83f00(0000) GS:ffff938b2e600000(0000) knlGS:0000000000000000 > [68620.214445] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > [68620.214447] CR2: 00007fc75b53f264 CR3: 00000001797f4000 CR4: 0000000000350ef0 > [68620.214449] Call Trace: > [68620.214450] <IRQ> > [68620.214451] ? watchdog_timer_fn+0x1dd/0x260 > [68620.214454] ? __pfx_watchdog_timer_fn+0x10/0x10 > [68620.214457] ? __hrtimer_run_queues+0x10f/0x2a0 > [68620.214460] ? hrtimer_interrupt+0xfa/0x230 > [68620.214462] ? __sysvec_apic_timer_interrupt+0x55/0x150 > [68620.214465] ? sysvec_apic_timer_interrupt+0x6c/0x90 > [68620.214468] </IRQ> > [68620.214469] <TASK> > [68620.214470] ? asm_sysvec_apic_timer_interrupt+0x1a/0x20 > [68620.214474] ? native_queued_spin_lock_slowpath+0x21f/0x2e0 > [68620.214477] _raw_spin_lock+0x29/0x30 > [68620.214479] zswap_load+0x6a/0x160 ... and I don't how a zswap lock could be related to a page table lock (in case it is one). > [68620.214482] swap_read_folio+0x64/0x450 > [68620.214484] swapin_readahead+0x1ea/0x4e0 > [68620.214487] do_swap_page+0x403/0xd20 > [68620.214490] ? shmem_file_write_iter+0x5e/0x90 > [68620.214492] ? __pte_offset_map+0x1b/0x180 > [68620.214494] __handle_mm_fault+0x868/0xdd0 > [68620.214498] handle_mm_fault+0x18d/0x320 > [68620.214500] do_user_addr_fault+0x175/0x6b0 > [68620.214503] exc_page_fault+0x7e/0x180 > [68620.214505] asm_exc_page_fault+0x26/0x30 <snip> > [68620.214508] RIP: 0033:0x330a353 > [68620.214512] Code: e2 03 48 01 d0 48 8b 00 48 89 45 e8 48 83 7d e8 00 0f 84 11 01 00 00 48 83 7d e8 ff 75 08 8b 45 fc 89 45 f8 eb 42 48 8b 45 e8 <8b> 40 0c 39 45 84 75 36 48 8b 45 e8 8b 40 08 48 8b 55 88 39 d0 75 > [68620.214515] RSP: 002b:00007ffc42ae0390 EFLAGS: 00010217 > [68620.214517] RAX: 00007fc75b53f258 RBX: 00000000000003e9 RCX: 00000000f9107c14 > [68620.214519] RDX: 000000000003e0a0 RSI: 00007ffc42ae04f1 RDI: 0000000027ef6180 > [68620.214521] RBP: 00007ffc42ae0410 R08: 0000000000000000 R09: 0000000000000000 > [68620.214523] R10: 00007fc78c106ac0 R11: 00007fc78c1073c0 R12: 0000000000000000 > [68620.214525] R13: 00007ffc42ae1030 R14: 00007fc78c66f000 R15: 0000000003df8e50 > [68620.214528] </TASK> > [68632.363664] watchdog: BUG: soft lockup - CPU#8 stuck for 648s! [cc1plus:2982130] > [68632.363668] Modules linked in: tls rpcsec_gss_krb5 nfsv4 dns_resolver nfs netfs rpcrdma rdma_cm iw_cm ib_cm ib_core br_netfilter iptable_filter xt_physdev tun bridge stp llc ext4 crc16 mbcache jbd2 amd_atl intel_rapl_msr intel_rapl_common edac_mce_amd kvm_amd cfg80211 rfkill kvm crct10dif_pclmul crc32_pclmul polyval_clmulni polyval_generic gf128mul ghash_clmulni_intel sha512_ssse3 sha256_ssse3 sha1_ssse3 r8169 aesni_intel crypto_simd cryptd realtek mdio_devres sp5100_tco wmi_bmof k10temp libphy ccp pcspkr rapl i2c_piix4 acpi_cpufreq zenpower ryzen_smu gpio_amdpt gpio_generic mac_hid nfsd auth_rpcgss nfs_acl lockd grace nct6775 nct6775_core hwmon_vid sunrpc sg crypto_user fuse dm_mod loop nfnetlink bpf_preload ip_tables x_tables xfs libcrc32c crc32c_generic drm_ttm_helper ttm video gpu_sched i2c_algo_bit drm_gpuvm drm_exec mxm_wmi nvme drm_display_helper crc32c_intel xhci_pci nvme_core cec xhci_pci_renesas wmi virtio_net net_failover failover virtio_blk virtio_pci virtio_pci_legacy_dev virtio_pci_modern_dev > [68632.363704] [last unloaded: nouveau] > [68632.363719] CPU: 8 PID: 2982130 Comm: cc1plus Tainted: G D W L 6.9.12-12 #1 e59bce453550af16b12fd25785f4d449e921764e > [68632.363722] Hardware name: To Be Filled By O.E.M. B450M Pro4-F R2.0/B450M Pro4-F R2.0, BIOS P10.08 01/19/2024 > [68632.363724] RIP: 0010:native_queued_spin_lock_slowpath+0x2a1/0x2e0 > [68632.363728] Code: c1 ea 12 83 e0 03 83 ea 01 48 c1 e0 05 48 63 d2 48 05 c0 73 03 00 48 03 04 d5 40 32 91 aa 48 89 28 8b 45 08 85 c0 75 09 f3 90 <8b> 45 08 85 c0 74 f7 48 8b 55 00 48 85 d2 0f 84 6a ff ff ff 0f 0d > [68632.363732] RSP: 0000:ffffb26885e1f450 EFLAGS: 00000246 > [68632.363734] RAX: 0000000000000000 RBX: ffff9388140cf738 RCX: fffffbc30f2ad340 > [68632.363736] RDX: 0000000000000014 RSI: 0000000000540101 RDI: ffff9388140cf738 > [68632.363738] RBP: ffff938b2ea373c0 R08: ffff93876cc2aaa0 R09: 0008c8130ae03aa0 > [68632.363740] R10: 020f0008c8130ae0 R11: 0000000000501000 R12: 0000000000240000 > [68632.363741] R13: 0000000000240000 R14: 03ffffffffffffff R15: 00000000000005fa > [68632.363743] FS: 00007fd929957f00(0000) GS:ffff938b2ea00000(0000) knlGS:0000000000000000 > [68632.363746] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > [68632.363748] CR2: 00007fd923600000 CR3: 0000000162ba8000 CR4: 0000000000350ef0 > [68632.363750] Call Trace: > [68632.363751] <IRQ> > [68632.363752] ? watchdog_timer_fn+0x1dd/0x260 > [68632.363755] ? __pfx_watchdog_timer_fn+0x10/0x10 > [68632.363758] ? __hrtimer_run_queues+0x10f/0x2a0 > [68632.363761] ? hrtimer_interrupt+0xfa/0x230 > [68632.363763] ? __sysvec_apic_timer_interrupt+0x55/0x150 > [68632.363766] ? sysvec_apic_timer_interrupt+0x6c/0x90 > [68632.363769] </IRQ> > [68632.363770] <TASK> > [68632.363771] ? asm_sysvec_apic_timer_interrupt+0x1a/0x20 > [68632.363775] ? native_queued_spin_lock_slowpath+0x2a1/0x2e0 > [68632.363778] _raw_spin_lock+0x29/0x30 > [68632.363781] zswap_store+0x623/0xc70 FWIW this is the same zswap lock as above. Also, could you try a memtest86 on your machine, to shake out potential hardware problems? All-in-all if the above is a page table lock then this is a weird bug, because I don't see how a zswap lock could be related to a ptlock through memory corruption, since ptdescs are just struct pages... Either this is has to be a different bug than the one I reported back then, or there's some side effect that's non-obvious to me. -- Pedro