koverstreet / bcachefs

Other
662 stars 70 forks source link

Page alloc trace #598

Closed YellowOnion closed 9 months ago

YellowOnion commented 11 months ago
[267990.785597] ------------[ cut here ]------------
[267990.785600] WARNING: CPU: 4 PID: 417656 at mm/page_alloc.c:2818 get_page_from_freelist (mm/page_alloc.c:2818 mm/page_alloc.c:3218)
[267990.785608] Modules linked in: msr snd_seq_dummy snd_hrtimer snd_seq af_packet xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nf_reject_ipv4 xt_tcpudp nft_compat nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables nfnetlink xfs nls_iso8859_1 nls_cp437 vfat fat amdgpu amdxcp iommu_v2 drm_buddy gpu_sched drm_suballoc_helper drm_ttm_helper ttm drm_display_helper drm_kms_helper edac_mce_amd edac_core eeepc_wmi asus_wmi snd_hda_codec_realtek snd_hda_codec_generic battery agpgart snd_hda_codec_hdmi snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec intel_rapl_msr intel_rapl_common crc32_pclmul ledtrig_audio snd_usb_audio wacom i2c_algo_bit snd_usbmidi_lib snd_hda_core r8169 snd_rawmidi snd_hwdep snd_seq_device polyval_clmulni realtek polyval_generic gf128mul snd_pcm ghash_clmulni_intel sha512_ssse3 sha512_generic aesni_intel libaes snd_timer mdio_devres sparse_keymap crypto_simd platform_profile tiny_power_button wmi_bmof snd cryptd hid_glorious sp5100_tco libphy watchdog mousedev
[267990.785690]  joydev evdev input_leds video soundcore i2c_piix4 k10temp mac_hid cfg80211 tpm_crb rapl button tpm_tis gpio_amdpt tpm_tis_core gpio_generic wmi rfkill sch_fq_codel uinput atkbd libps2 serio vivaldi_fmap loop tun tap macvlan bridge stp llc kvm_amd ccp kvm irqbypass v4l2loopback(O) videodev drm mc led_class fuse deflate configfs efi_pstore backlight efivarfs tpm rng_core dmi_sysfs ip_tables x_tables autofs4 hid_generic usbhid hid bcachefs libcrc32c crc32c_generic xor lz4hc_compress lz4_compress mean_and_variance raid6_pq sd_mod xhci_pci xhci_pci_renesas firmware_class xhci_hcd ahci libahci libata nvme nvme_core usbcore scsi_mod t10_pi crc32c_intel crc64_rocksoft crc_t10dif crct10dif_generic crct10dif_pclmul crc64 usb_common scsi_common crct10dif_common rtc_cmos dm_mod dax
[267990.785786] CPU: 4 PID: 417656 Comm: ld.mold Tainted: G           O       6.5.4 #1-NixOS
[267990.785788] Hardware name: ASUS System Product Name/TUF GAMING B550-PLUS, BIOS 2806 10/27/2022
[267990.785790] RIP: 0010:get_page_from_freelist (mm/page_alloc.c:2818 mm/page_alloc.c:3218)
[267990.785794] Code: 24 a0 00 00 00 8b 70 18 48 8b 40 10 48 8b 00 89 74 24 50 48 89 84 24 98 00 00 00 45 85 d2 74 0c 41 83 fc 01 0f 86 96 06 00 00 <0f> 0b 41 83 fc 03 0f 86 8a 06 00 00 41 83 fc 09 0f 84 80 06 00 00
All code
========
   0:   24 a0                   and    $0xa0,%al
   2:   00 00                   add    %al,(%rax)
   4:   00 8b 70 18 48 8b       add    %cl,-0x74b7e790(%rbx)
   a:   40 10 48 8b             rex adc %cl,-0x75(%rax)
   e:   00 89 74 24 50 48       add    %cl,0x48502474(%rcx)
  14:   89 84 24 98 00 00 00    mov    %eax,0x98(%rsp)
  1b:   45 85 d2                test   %r10d,%r10d
  1e:   74 0c                   je     0x2c
  20:   41 83 fc 01             cmp    $0x1,%r12d
  24:   0f 86 96 06 00 00       jbe    0x6c0
  2a:*  0f 0b                   ud2             <-- trapping instruction
  2c:   41 83 fc 03             cmp    $0x3,%r12d
  30:   0f 86 8a 06 00 00       jbe    0x6c0
  36:   41 83 fc 09             cmp    $0x9,%r12d
  3a:   0f 84 80 06 00 00       je     0x6c0

Code starting with the faulting instruction
===========================================
   0:   0f 0b                   ud2
   2:   41 83 fc 03             cmp    $0x3,%r12d
   6:   0f 86 8a 06 00 00       jbe    0x696
   c:   41 83 fc 09             cmp    $0x9,%r12d
  10:   0f 84 80 06 00 00       je     0x696
[267990.785796] RSP: 0000:ffffb6b84720b9c0 EFLAGS: 00010202
[267990.785798] RAX: ffffa126ef37ad80 RBX: 0000000000005844 RCX: 0000000000000003
[267990.785800] RDX: 0000000000000001 RSI: 0000000000000000 RDI: ffffa126ef37ad80
[267990.785802] RBP: 0000000000000000 R08: 0000000000000000 R09: ffffa126ef37afb8
[267990.785803] R10: 0000000000008000 R11: 0000000000000000 R12: 0000000000000003
[267990.785805] R13: ffffa126ef37c1c0 R14: 0000000000000001 R15: ffffa126ef37ad80
[267990.785807] FS:  00007ffff77d3800(0000) GS:ffffa126ceb00000(0000) knlGS:0000000000000000
[267990.785809] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[267990.785811] CR2: 00007fffed2f4030 CR3: 000000019b5b8000 CR4: 0000000000750ee0
[267990.785813] PKRU: 55555554
[267990.785814] Call Trace:
[267990.785816]  <TASK>
[267990.785818] ? get_page_from_freelist (mm/page_alloc.c:2818 mm/page_alloc.c:3218)
[267990.785821] ? __warn (kernel/panic.c:673)
[267990.785827] ? get_page_from_freelist (mm/page_alloc.c:2818 mm/page_alloc.c:3218)
[267990.785830] ? report_bug (lib/bug.c:180 lib/bug.c:219)
[267990.785836] ? handle_bug (arch/x86/kernel/traps.c:303)
[267990.785840] ? exc_invalid_op (arch/x86/kernel/traps.c:345 (discriminator 1))
[267990.785842] ? asm_exc_invalid_op (arch/x86/include/asm/idtentry.h:568)
[267990.785849] ? get_page_from_freelist (mm/page_alloc.c:2818 mm/page_alloc.c:3218)
WARNING! Modules path isn't set, but is needed to parse this symbol
[267990.785857] ? bch2_filemap_get_contig_folios_d+0x96/0x1e0 bcachefs
[267990.785913] __alloc_pages (mm/page_alloc.c:4477)
WARNING! Modules path isn't set, but is needed to parse this symbol
[267990.785918] ? __bch2_folio_create+0x3c/0x60 bcachefs
[267990.785969] __kmalloc_large_node (mm/slab_common.c:1120)
[267990.785973] __kmalloc (arch/x86/include/asm/bitops.h:409 include/asm-generic/getorder.h:46 mm/slab_common.c:976 mm/slab_common.c:999)
WARNING! Modules path isn't set, but is needed to parse this symbol
[267990.785977] __bch2_folio_create+0x3c/0x60 bcachefs
WARNING! Modules path isn't set, but is needed to parse this symbol
[267990.786025] bch2_readahead+0x16e/0x370 bcachefs
[267990.786077] read_pages (include/linux/pagemap.h:1243 include/linux/pagemap.h:1285 mm/readahead.c:166)
[267990.786082] page_cache_ra_order (include/linux/fs.h:839 mm/readahead.c:549)
[267990.786086] filemap_fault (mm/filemap.c:3169 mm/filemap.c:3297)
[267990.786091] ? srso_alias_return_thunk (arch/x86/lib/retpoline.S:186)
[267990.786095] ? __memcg_kmem_charge_page (mm/memcontrol.c:3136)
WARNING! Modules path isn't set, but is needed to parse this symbol
[267990.786100] bch2_page_fault+0x15e/0x1e0 bcachefs
[267990.786149] __do_fault (mm/memory.c:4198)
[267990.786153] do_fault (mm/memory.c:4602 mm/memory.c:4674)
[267990.786157] __handle_mm_fault (mm/memory.c:3664 mm/memory.c:4939 mm/memory.c:5079)
[267990.786164] handle_mm_fault (mm/memory.c:5233)
[267990.786168] do_user_addr_fault (arch/x86/mm/fault.c:1392)
[267990.786173] exc_page_fault (arch/x86/include/asm/paravirt.h:695 arch/x86/mm/fault.c:1494 arch/x86/mm/fault.c:1542)
[267990.786177] asm_exc_page_fault (arch/x86/include/asm/idtentry.h:570)
[267990.786180] RIP: 0033:0xa4232e
[267990.786204] Code: 41 54 53 48 83 ec 18 49 89 f7 64 48 8b 04 25 28 00 00 00 48 89 44 24 10 4c 8b a6 40 0d 00 00 48 8b 5f 30 4d 8d 34 1c 0f 57 c0 <41> 0f 11 44 1c 30 41 0f 11 44 1c 20 41 0f 11 44 1c 10 41 0f 11 04
All code
========
   0:   41 54                   push   %r12
   2:   53                      push   %rbx
   3:   48 83 ec 18             sub    $0x18,%rsp
   7:   49 89 f7                mov    %rsi,%r15
   a:   64 48 8b 04 25 28 00    mov    %fs:0x28,%rax
  11:   00 00
  13:   48 89 44 24 10          mov    %rax,0x10(%rsp)
  18:   4c 8b a6 40 0d 00 00    mov    0xd40(%rsi),%r12
  1f:   48 8b 5f 30             mov    0x30(%rdi),%rbx
  23:   4d 8d 34 1c             lea    (%r12,%rbx,1),%r14
  27:   0f 57 c0                xorps  %xmm0,%xmm0
  2a:*  41 0f 11 44 1c 30       movups %xmm0,0x30(%r12,%rbx,1)          <-- trapping instruction
  30:   41 0f 11 44 1c 20       movups %xmm0,0x20(%r12,%rbx,1)
  36:   41 0f 11 44 1c 10       movups %xmm0,0x10(%r12,%rbx,1)
  3c:   41                      rex.B
  3d:   0f                      .byte 0xf
  3e:   11                      .byte 0x11
  3f:   04                      .byte 0x4

Code starting with the faulting instruction
===========================================
   0:   41 0f 11 44 1c 30       movups %xmm0,0x30(%r12,%rbx,1)
   6:   41 0f 11 44 1c 20       movups %xmm0,0x20(%r12,%rbx,1)
   c:   41 0f 11 44 1c 10       movups %xmm0,0x10(%r12,%rbx,1)
  12:   41                      rex.B
  13:   0f                      .byte 0xf
  14:   11                      .byte 0x11
  15:   04                      .byte 0x4
[267990.786206] RSP: 002b:00007fffffff7440 EFLAGS: 00010202
[267990.786208] RAX: 6aa6499c34cf1b00 RBX: 0000000000000000 RCX: 0000000000000024
[267990.786210] RDX: 0000000000000023 RSI: 00007fffffff7d00 RDI: 000005ca0816c440
[267990.786211] RBP: 00007fffffff74a0 R08: 0000000000000000 R09: 00007fff00000000
[267990.786213] R10: 00007fffffff7348 R11: 0000000000000246 R12: 00007fffed2f4000
[267990.786214] R13: 00007fffffff7d00 R14: 00007fffed2f4000 R15: 00007fffffff7d00
[267990.786219]  </TASK>
[267990.786221] ---[ end trace 0000000000000000 ]---
jpsollie commented 11 months ago

is it possible this is a compiler bug? I see an "invalid instruction" in the log ... that's pretty much a compiler issue, as there is no assembly in the code afaik

YellowOnion commented 11 months ago

@jpsollie that's just how the kernel deals with errors I'm pretty sure.

I just noticed I forgot to set the modules path so that trace is useless lol.