WARNING on latest master due to DYNAMIC_PREEMPT and cond_resched()

From: Steven Rostedt
Date: Thu Feb 25 2021 - 13:13:37 EST


I got this warning dump on latest master (while fixing the kmem trace event)

------------[ cut here ]------------
unexpected static_call insn opcode 0xe9 at drm_gem_check_release_pagevec+0x2a/0x30 [drm]
WARNING: CPU: 6 PID: 646 at arch/x86/kernel/static_call.c:77 __static_call_validate+0x68/0x80
Modules linked in: drm(+) e1000e(+) crct10dif_pclmul i2c_i801 crc32_pclmul snd_seq_device crc32c_intel wmi snd_pcm serio_raw mei_me tpm_infineon i2c_smbus video mei ghash_clmulni_intel lpc_ich snd_timer snd soundcore ip_tables
CPU: 6 PID: 646 Comm: systemd-udevd Not tainted 5.11.0-test+ #24
Hardware name: Hewlett-Packard HP Compaq Pro 6300 SFF/339A, BIOS K01 v03.03 07/14/2016
RIP: 0010:__static_call_validate+0x68/0x80
Code: 05 4f 7a fc 00 75 d7 0f b6 05 4a 7a fc 00 38 47 04 75 cb c3 48 89 fa 48 c7 c7 a0 66 35 89 c6 05 cd 92 9a 01 01 e8 d7 72 b2 00 <0f> 0b c3 0f b6 4a 04 38 4f 04 75 c9 c3 c3 66 2e 0f 1f 84 00 00 00
e1000e 0000:00:19.0 0000:00:19.0 (uninitialized): registered PHC clock
RSP: 0018:ffffa67d0050fc30 EFLAGS: 00010286
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff9584da800000
RDX: 0000000000000000 RSI: ffffffff88156d6f RDI: ffffffff88156d6f
RBP: ffffffffc0219f2a R08: 00000007e8bf25a1 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000001 R12: ffffffff8826c3c0
R13: 0000000000000000 R14: ffffffffc0219f2a R15: ffffffffc0293e1b
FS: 00007f4bd2a29940(0000) GS:ffff9584da800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fd14f762f44 CR3: 00000001069ce003 CR4: 00000000001706e0
Call Trace:
arch_static_call_transform+0x5f/0x90
__static_call_init.part.0+0x15f/0x210
? __SCT__tp_func_sched_update_nr_running_tp+0x8/0x8
static_call_module_notify+0x6b/0x190
e1000e 0000:00:19.0 eth0: (PCI Express:2.5GT/s:Width x1) b4:b5:2f:ce:18:65
notifier_call_chain_robust+0x5a/0xc0
e1000e 0000:00:19.0 eth0: Intel(R) PRO/1000 Network Connection
blocking_notifier_call_chain_robust+0x43/0x60
e1000e 0000:00:19.0 eth0: MAC: 10, PHY: 11, PBA No: 0100FF-0FF
load_module+0x2256/0x2ca0
? __kernel_read+0x152/0x2d0
? kernel_read_file+0x220/0x280
? __do_sys_finit_module+0xb1/0x110
__do_sys_finit_module+0xb1/0x110
do_syscall_64+0x33/0x40
entry_SYSCALL_64_after_hwframe+0x44/0xae

It appears to be tripping up oven the static caller in cond_resched() in
that function.

Attached is my config.

-- Steve

Attachment: config.gz
Description: application/gzip