Bug 214159 - WARNING: CPU: 0 PID: 0 at kernel/kthread.c:83 kthread_is_per_cpu+0x1c/0x30
Summary: WARNING: CPU: 0 PID: 0 at kernel/kthread.c:83 kthread_is_per_cpu+0x1c/0x30
Status: RESOLVED CODE_FIX
Alias: None
Product: Platform Specific/Hardware
Classification: Unclassified
Component: x86-64 (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: platform_x86_64@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-24 09:51 UTC by Erik Quaeghebeur
Modified: 2021-08-30 11:06 UTC (History)
1 user (show)

See Also:
Kernel Version: 5.10.60
Subsystem:
Regression: No
Bisected commit-id:


Attachments
backported potential fix (4.09 KB, patch)
2021-08-24 20:22 UTC, Borislav Petkov
Details | Diff

Description Erik Quaeghebeur 2021-08-24 09:51:56 UTC
I got the following installation of 5.10.60 (to fix a bug in earlier kernels). This is for a Ryzen 4750U system (Lenovo T14 AMD). Let me know if I need to supply more information to make this report useful.

------------[ cut here ]------------
WARNING: CPU: 0 PID: 0 at kernel/kthread.c:83 kthread_is_per_cpu+0x1c/0x30
Modules linked in: ctr ccm tcp_diag inet_diag rfcomm uhid nft_objref nf_conntrack_netbios_ns nf_conntrack_broadcast hid_generic usbhid snd_usb_audio snd_hwdep snd_usbmidi_lib snd_rawmidi snd_seq_device sd_mod cdc_ether usbnet r8152 mii af_packet uas usb_storage scsi_mod nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_tables ebtable_nat ebtable_broute ip6table_nat mousedev ip6table_mangle ip6table_raw ip6table_security iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 iptable_mangle iptable_raw iptable_security cmac ip_set nfnetlink ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter ip_tables x_tables bnep btusb btintel bluetooth ecdh_generic ecc uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_common videodev mc ext4 crc16 mbcache jbd2 kvm_amd snd_hda_codec_realtek kvm snd_hda_codec_generic irqbypass crct10dif_pclmul crc32_pclmul
 snd_hda_codec_hdmi ghash_clmulni_intel aesni_intel iwlmvm glue_helper libaes snd_hda_intel crypto_simd cryptd snd_intel_dspcfg snd_acp3x_rn mac80211 snd_hda_codec snd_acp3x_pdm_dma snd_soc_dmic libarc4 rtsx_pci_sdmmc sp5100_tco snd_soc_core snd_hda_core mmc_core watchdog input_leds 8250_pci psmouse xhci_pci rapl xhci_pci_renesas serio_raw iwlwifi snd_rn_pci_acp3x ehci_pci 8250 snd_pcm r8169 k10temp xhci_hcd ehci_hcd i2c_piix4 8250_base realtek snd_pci_acp3x snd_timer ccp thinkpad_acpi cfg80211 rtsx_pci mdio_devres tpm_tis serial_mctrl_gpio usbcore libphy tpm_tis_core serial_core usb_common ucsi_acpi nvram ledtrig_audio tpm typec_ucsi snd typec rng_core soundcore led_class rfkill rtc_cmos i2c_scmi acpi_cpufreq pinctrl_amd evdev sch_fq_codel lm92 msr fuse configfs efivarfs
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.10.60-gentoo+tracing #1
Hardware name: LENOVO 20UDS0DK00/20UDS0DK00, BIOS R1BET65W(1.34 ) 06/17/2021
RIP: 0010:kthread_is_per_cpu+0x1c/0x30
Code: 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 f6 47 26 20 74 16 48 8b 87 d0 04 00 00 48 85 c0 74 07 48 8b 00 83 e0 01 c3 31 c0 c3 <0f> 0b 66 90 eb e4 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 41 55
RSP: 0018:ffffa71d80003df8 EFLAGS: 00010046
RAX: 0000000000000001 RBX: ffffa71d80003e88 RCX: ffffa315df840000
RDX: 0000000000000020 RSI: ffffa71d80003e88 RDI: ffffa30d252327c0
RBP: ffffa30d252327c0 R08: 0000000a3880f243 R09: 0000000000000020
R10: 0000000000000400 R11: 0000000000000064 R12: 0000000000000000
R13: ffffa30d252327c0 R14: ffffa30d25232868 R15: ffffa315df869800
FS:  0000000000000000(0000) GS:ffffa315df800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005598db2cfae0 CR3: 000000014d1b4000 CR4: 0000000000350ef0
Call Trace:
 <IRQ>
 can_migrate_task+0x13/0x100
 detach_tasks+0x97/0x270
 load_balance+0x1c3/0x6a0
 rebalance_domains+0x290/0x3a0
 __do_softirq+0xb9/0x265
 asm_call_irq_on_stack+0x12/0x20
 </IRQ>
 do_softirq_own_stack+0x31/0x40
 irq_exit_rcu+0x84/0xc0
 sysvec_apic_timer_interrupt+0x2e/0x80
 asm_sysvec_apic_timer_interrupt+0x12/0x20
RIP: 0010:cpuidle_enter_state+0xcb/0x330
Code: 49 89 c5 0f 1f 44 00 00 31 ff e8 f0 4d 7f ff 45 84 ff 74 12 9c 58 f6 c4 02 0f 85 46 02 00 00 31 ff e8 a9 79 84 ff fb 45 85 f6 <0f> 88 e0 00 00 00 49 63 ce be 68 00 00 00 4c 2b 2c 24 48 89 c8 48
RSP: 0018:ffffffffa5a03e68 EFLAGS: 00000202
RAX: ffffa315df829800 RBX: 0000000000000001 RCX: 000000000000001f
RDX: 0000000000000000 RSI: 000000004adf4228 RDI: 0000000000000000
RBP: ffffa30b00afb000 R08: 0000000a3880cf7f R09: 000000000000000a
R10: ffffa315df828a64 R11: 0000000000000002 R12: ffffffffa5b525c0
R13: 0000000a3880cf7f R14: 0000000000000001 R15: 0000000000000000
 ? cpuidle_enter_state+0xb0/0x330
 cpuidle_enter+0x32/0x50
 cpuidle_idle_call+0x143/0x1f0
 do_idle+0x75/0xd0
 cpu_startup_entry+0x14/0x20
 start_kernel+0x450/0x46f
 secondary_startup_64_no_verify+0xb0/0xbb
---[ end trace 0ce04340d5412ee9 ]---
Comment 1 Borislav Petkov 2021-08-24 20:21:23 UTC
I'm being told there might be a patch missing in 5.10. Can you try the attached one?

Thx.
Comment 2 Borislav Petkov 2021-08-24 20:22:57 UTC
Created attachment 298459 [details]
backported potential fix

5.10 backport of

3a7956e25e1d ("kthread: Fix PF_KTHREAD vs to_kthread() race")
Comment 3 Erik Quaeghebeur 2021-08-30 10:25:20 UTC
(In reply to Borislav Petkov from comment #1)
> I'm being told there might be a patch missing in 5.10. Can you try the
> attached one?

I added your patch and the problem has since not reappeared. I guess the patch needs to be added to the next bugfix release of the 5.10 line.
Comment 4 Borislav Petkov 2021-08-30 11:06:24 UTC
Cool, thanks for testing.

Forwarded to stable@ folks and closing here.

Note You need to log in before you can comment on or make changes to this bug.