Skip to contentSkip to conversation

c9b55f9da0: WARNING:at_kernel/rcu/rcutorture.c:#rcutorture_one_extend_check[rcutorture]

linux-next:master In review kernel test robot 3 participants 16 messages Feb 17, 2025 – Feb 25, 2025

Subsystems (2)
lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw

hi, Ankur Arora and all,

this is not a regression report as our bot normally does. this report is just FYI that we observe a WARNING with this config, in case it could supply any useful information and/or somebody wants to have a look.

by this change, the config has below diff with parent:

==================== PARENT FIRST_BAD KCONFIGS f001b7165def8f7af6ce95d08f0e1bbc2442654d ====================

pkg/linux/i386-randconfig-r121-20250212/gcc-12/c9b55f9da0d2c72c8c8d8cd5df84af5251b74283/.config 2025-02-13 08:43:08.186415593 +0800 renamed from pkg/linux/i386-randconfig-r121-20250212/gcc-12/f001b7165def8f7af6ce95d08f0e1bbc2442654d/.config 2025-02-13 07:56:33.420457682 +0800 +0 -2
@@ -147,7 +147,6 @@ CONFIG_BSD_PROCESS_ACCT=y
 # RCU Subsystem
 #
 CONFIG_TREE_RCU=y
-CONFIG_PREEMPT_RCU=y
 CONFIG_RCU_EXPERT=y
 CONFIG_TREE_SRCU=y
 CONFIG_TASKS_RCU_GENERIC=y
@@ -162,7 +161,6 @@ CONFIG_RCU_STALL_COMMON=y
 CONFIG_RCU_NEED_SEGCBLIST=y
 CONFIG_RCU_FANOUT=32
 CONFIG_RCU_FANOUT_LEAF=16
-# CONFIG_RCU_BOOST is not set
 # CONFIG_RCU_NOCB_CPU is not set
 # CONFIG_TASKS_TRACE_RCU_READ_MB is not set
 # CONFIG_RCU_DOUBLE_CHECK_CB_TIME is not set

below is full report.

Hello,

kernel test robot noticed "WARNING:at_kernel/rcu/rcutorture.c:#rcutorture_one_extend_check[rcutorture]" on:

commit: c9b55f9da0d2c72c8c8d8cd5df84af5251b74283 ("rcu: limit PREEMPT_RCU configurations")
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master

[test failed on linux-next/master c674aa7c289e51659e40dda0f954886ef7f80042]

in testcase: rcutorture
version:
with following parameters:

	runtime: 300s
	test: cpuhotplug
	torture_type: rcu

config: i386-randconfig-r121-20250212
compiler: gcc-12
test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 16G

(please refer to attached dmesg/kmsg for entire log/backtrace)

+-----------------------------------------------------------------------------+------------+------------+
|                                                                             | f001b7165d | c9b55f9da0 |
+-----------------------------------------------------------------------------+------------+------------+
| WARNING:at_kernel/rcu/rcutorture.c:#rcutorture_one_extend_check[rcutorture] | 0          | 12         |
| EIP:rcutorture_one_extend_check                                             | 0          | 12         |
+-----------------------------------------------------------------------------+------------+------------+

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-lkp/[email protected]

The kernel config and materials to reproduce are available at:
https://download.01.org/0day-ci/archive/20250217/[email protected]

[  109.553253][  T781] rcu-torture: rcu_torture_reader task started
[  109.553258][  T781] ------------[ cut here ]------------
[  109.553259][  T781] rcutorture_one_extend_check during change: Current 0x4  To add 0x4  To remove 0x0  preempt_count() 0x1
[  109.553292][  T781] WARNING: CPU: 1 PID: 781 at kernel/rcu/rcutorture.c:1905 rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553302][  T781] Modules linked in: rcutorture(+) torture
[  109.553307][  T781] CPU: 1 UID: 0 PID: 781 Comm: rcu_torture_rea Tainted: G                T  6.14.0-rc1-00007-gc9b55f9da0d2 #1
[  109.553310][  T781] Tainted: [T]=RANDSTRUCT
[  109.553311][  T781] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
[  109.553312][  T781] EIP: rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553318][  T781] Code: 75 2d c6 05 fd 04 1c f1 01 64 a1 84 77 7c 97 25 ff ff ff 7f 50 ff 75 08 57 53 56 68 60 9f 1c f1 68 a4 74 1c f1 e8 8d d3 ca a3 <0f> 0b 83 c4 1c 8d 65 f4 5b 5e 5f 5d c3 55 31 d2 83 f8 1f 89 e5 53
[  109.553320][  T781] EAX: 00000066 EBX: 00000004 ECX: 00000027 EDX: e89c1a00
[  109.553322][  T781] ESI: f11c92d9 EDI: 00000004 EBP: 825d1d88 ESP: 825d1d54
[  109.553323][  T781] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 EFLAGS: 00010282
[  109.553327][  T781] CR0: 80050033 CR2: 77235000 CR3: 010c5000 CR4: 00040690
[  109.553328][  T781] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
[  109.553330][  T781] DR6: fffe0ff0 DR7: 00000400
[  109.553331][  T781] Call Trace:
[  109.553333][  T781]  ? show_regs+0x4c/0x52
[  109.553343][  T781]  ? rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553349][  T781]  ? __warn+0x9e/0x15f
[  109.553354][  T781]  ? report_bug+0xe8/0x14a
[  109.553357][  T781]  ? rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553364][  T781]  ? exc_overflow+0x37/0x37
[  109.553367][  T781]  ? handle_bug+0x3a/0x55
[  109.553369][  T781]  ? exc_invalid_op+0x1a/0x56
[  109.553372][  T781]  ? handle_exception+0x148/0x148
[  109.553376][  T781]  ? osq_wait_next+0x18/0x41
[  109.553379][  T781]  ? exc_overflow+0x37/0x37
[  109.553381][  T781]  ? rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553388][  T781]  ? exc_overflow+0x37/0x37
[  109.553390][  T781]  ? rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553399][  T781]  rcutorture_one_extend+0x18c/0x3c1 [rcutorture]
[  109.553410][  T781]  rcu_torture_one_read+0x95/0x4d2 [rcutorture]
[  109.553417][  T781]  ? validate_chain+0x3d/0x24c
[  109.553420][  T781]  ? mark_lock+0x6a/0x14d
[  109.553440][  T781]  rcu_torture_reader+0xc4/0xdbd [rcutorture]
[  109.553448][  T781]  ? rcu_torture_one_read+0x4d2/0x4d2 [rcutorture]
[  109.553457][  T781]  kthread+0x169/0x16e
[  109.553459][  T781]  ? rcu_torture_read_exit_child+0x3a/0x3a [rcutorture]
[  109.553466][  T781]  ? kthread_is_per_cpu+0x17/0x17
[  109.553468][  T781]  ret_from_fork+0x19/0x2c
[  109.553471][  T781]  ? kthread_is_per_cpu+0x17/0x17
[  109.553472][  T781]  ret_from_fork_asm+0x12/0x20
[  109.553475][  T781]  entry_INT80_32+0x108/0x108
[  109.553481][  T781] irq event stamp: 307
[  109.553482][  T781] hardirqs last  enabled at (313): [<94ebb6cb>] console_trylock_spinning+0x6b/0x10a
[  109.553485][  T781] hardirqs last disabled at (318): [<94ebb691>] console_trylock_spinning+0x31/0x10a
[  109.553486][  T781] softirqs last  enabled at (0): [<94e613c4>] copy_process+0x945/0x1a7d
[  109.553489][  T781] softirqs last disabled at (0): [<00000000>] 0x0
[  109.553491][  T781] ---[ end trace 0000000000000000 ]---
[  109.553494][  T781] ------------[ cut here ]------------
[  109.553496][  T781] rcutorture_one_extend_check after change: Current 0x60  To add 0x60  To remove 0x4  preempt_count() 0x2
[  109.553510][  T781] WARNING: CPU: 1 PID: 781 at kernel/rcu/rcutorture.c:1902 rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553517][  T781] Modules linked in: rcutorture(+) torture
[  109.553520][  T781] CPU: 1 UID: 0 PID: 781 Comm: rcu_torture_rea Tainted: G        W       T  6.14.0-rc1-00007-gc9b55f9da0d2 #1
[  109.553523][  T781] Tainted: [W]=WARN, [T]=RANDSTRUCT
[  109.553524][  T781] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
[  109.553525][  T781] EIP: rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553530][  T781] Code: 3d fe 04 1c f1 00 75 27 25 ff ff ff 7f c6 05 fe 04 1c f1 01 50 ff 75 08 57 53 56 68 60 9f 1c f1 68 a4 74 1c f1 e8 da d3 ca a3 <0f> 0b 83 c4 1c a1 40 09 1c f1 8b 40 1c 85 c0 74 41 f6 c3 60 75 3c
[  109.553532][  T781] EAX: 00000067 EBX: 00000060 ECX: 00000027 EDX: e89c1a00
[  109.553533][  T781] ESI: f11c936d EDI: 00000060 EBP: 825d1d88 ESP: 825d1d54
[  109.553535][  T781] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 EFLAGS: 00010282
[  109.553537][  T781] CR0: 80050033 CR2: 77235000 CR3: 010c5000 CR4: 00040690
[  109.553539][  T781] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
[  109.553540][  T781] DR6: fffe0ff0 DR7: 00000400
[  109.553541][  T781] Call Trace:
[  109.553543][  T781]  ? show_regs+0x4c/0x52
[  109.553545][  T781]  ? rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553551][  T781]  ? __warn+0x9e/0x15f
[  109.553555][  T781]  ? report_bug+0xe8/0x14a
[  109.553558][  T781]  ? rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553565][  T781]  ? exc_overflow+0x37/0x37
[  109.553567][  T781]  ? handle_bug+0x3a/0x55
[  109.553569][  T781]  ? exc_invalid_op+0x1a/0x56
[  109.553572][  T781]  ? handle_exception+0x148/0x148
[  109.553575][  T781]  ? osq_wait_next+0x18/0x41
[  109.553578][  T781]  ? exc_overflow+0x37/0x37
[  109.553580][  T781]  ? rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553587][  T781]  ? exc_overflow+0x37/0x37
[  109.553589][  T781]  ? rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553599][  T781]  rcutorture_one_extend+0x3b7/0x3c1 [rcutorture]
[  109.553610][  T781]  rcu_torture_one_read+0x21b/0x4d2 [rcutorture]
[  109.553638][  T781]  rcu_torture_reader+0xc4/0xdbd [rcutorture]
[  109.553646][  T781]  ? rcu_torture_one_read+0x4d2/0x4d2 [rcutorture]
[  109.553655][  T781]  kthread+0x169/0x16e
[  109.553658][  T781]  ? rcu_torture_read_exit_child+0x3a/0x3a [rcutorture]
[  109.553664][  T781]  ? kthread_is_per_cpu+0x17/0x17
[  109.553667][  T781]  ret_from_fork+0x19/0x2c
[  109.553669][  T781]  ? kthread_is_per_cpu+0x17/0x17
[  109.553671][  T781]  ret_from_fork_asm+0x12/0x20
[  109.553673][  T781]  entry_INT80_32+0x108/0x108
[  109.553679][  T781] irq event stamp: 607
[  109.553680][  T781] hardirqs last  enabled at (613): [<94ebb6cb>] console_trylock_spinning+0x6b/0x10a
[  109.553682][  T781] hardirqs last disabled at (618): [<94ebb691>] console_trylock_spinning+0x31/0x10a
[  109.553684][  T781] softirqs last  enabled at (0): [<94e613c4>] copy_process+0x945/0x1a7d
[  109.553686][  T781] softirqs last disabled at (0): [<00000000>] 0x0
[  109.553688][  T781] ---[ end trace 0000000000000000 ]---
[  109.634034][  T769] rcu-torture: Creating torture_shuffle task
[  109.635952][  T782] rcu-torture: rcu_torture_stats task started
[  109.637994][  T769] rcu-torture: Creating torture_stutter task
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
maintainer
#1 lore raw
Quoted 169 lines · kernel test robot

hi, Ankur Arora and all,

this is not a regression report as our bot normally does. this report is just FYI that we observe a WARNING with this config, in case it could supply any useful information and/or somebody wants to have a look.

by this change, the config has below diff with parent:

==================== PARENT FIRST_BAD KCONFIGS f001b7165def8f7af6ce95d08f0e1bbc2442654d ====================

pkg/linux/i386-randconfig-r121-20250212/gcc-12/c9b55f9da0d2c72c8c8d8cd5df84af5251b74283/.config 2025-02-13 08:43:08.186415593 +0800 renamed from pkg/linux/i386-randconfig-r121-20250212/gcc-12/f001b7165def8f7af6ce95d08f0e1bbc2442654d/.config 2025-02-13 07:56:33.420457682 +0800 +0 -2
@@ -147,7 +147,6 @@ CONFIG_BSD_PROCESS_ACCT=y
 # RCU Subsystem
 #
 CONFIG_TREE_RCU=y
-CONFIG_PREEMPT_RCU=y
 CONFIG_RCU_EXPERT=y
 CONFIG_TREE_SRCU=y
 CONFIG_TASKS_RCU_GENERIC=y
@@ -162,7 +161,6 @@ CONFIG_RCU_STALL_COMMON=y
 CONFIG_RCU_NEED_SEGCBLIST=y
 CONFIG_RCU_FANOUT=32
 CONFIG_RCU_FANOUT_LEAF=16
-# CONFIG_RCU_BOOST is not set
 # CONFIG_RCU_NOCB_CPU is not set
 # CONFIG_TASKS_TRACE_RCU_READ_MB is not set
 # CONFIG_RCU_DOUBLE_CHECK_CB_TIME is not set

below is full report.

Hello,

kernel test robot noticed "WARNING:at_kernel/rcu/rcutorture.c:#rcutorture_one_extend_check[rcutorture]" on:

commit: c9b55f9da0d2c72c8c8d8cd5df84af5251b74283 ("rcu: limit PREEMPT_RCU configurations")
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master

[test failed on linux-next/master c674aa7c289e51659e40dda0f954886ef7f80042]

in testcase: rcutorture
version:
with following parameters:

	runtime: 300s
	test: cpuhotplug
	torture_type: rcu

config: i386-randconfig-r121-20250212
compiler: gcc-12
test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 16G

(please refer to attached dmesg/kmsg for entire log/backtrace)

+-----------------------------------------------------------------------------+------------+------------+
|                                                                             | f001b7165d | c9b55f9da0 |
+-----------------------------------------------------------------------------+------------+------------+
| WARNING:at_kernel/rcu/rcutorture.c:#rcutorture_one_extend_check[rcutorture] | 0          | 12         |
| EIP:rcutorture_one_extend_check                                             | 0          | 12         |
+-----------------------------------------------------------------------------+------------+------------+

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-lkp/[email protected]

The kernel config and materials to reproduce are available at:
https://download.01.org/0day-ci/archive/20250217/[email protected]

[  109.553253][  T781] rcu-torture: rcu_torture_reader task started
[  109.553258][  T781] ------------[ cut here ]------------
[  109.553259][  T781] rcutorture_one_extend_check during change: Current 0x4  To add 0x4  To remove 0x0  preempt_count() 0x1
[  109.553292][  T781] WARNING: CPU: 1 PID: 781 at kernel/rcu/rcutorture.c:1905 rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553302][  T781] Modules linked in: rcutorture(+) torture
[  109.553307][  T781] CPU: 1 UID: 0 PID: 781 Comm: rcu_torture_rea Tainted: G                T  6.14.0-rc1-00007-gc9b55f9da0d2 #1
[  109.553310][  T781] Tainted: [T]=RANDSTRUCT
[  109.553311][  T781] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
[  109.553312][  T781] EIP: rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553318][  T781] Code: 75 2d c6 05 fd 04 1c f1 01 64 a1 84 77 7c 97 25 ff ff ff 7f 50 ff 75 08 57 53 56 68 60 9f 1c f1 68 a4 74 1c f1 e8 8d d3 ca a3 <0f> 0b 83 c4 1c 8d 65 f4 5b 5e 5f 5d c3 55 31 d2 83 f8 1f 89 e5 53
[  109.553320][  T781] EAX: 00000066 EBX: 00000004 ECX: 00000027 EDX: e89c1a00
[  109.553322][  T781] ESI: f11c92d9 EDI: 00000004 EBP: 825d1d88 ESP: 825d1d54
[  109.553323][  T781] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 EFLAGS: 00010282
[  109.553327][  T781] CR0: 80050033 CR2: 77235000 CR3: 010c5000 CR4: 00040690
[  109.553328][  T781] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
[  109.553330][  T781] DR6: fffe0ff0 DR7: 00000400
[  109.553331][  T781] Call Trace:
[  109.553333][  T781]  ? show_regs+0x4c/0x52
[  109.553343][  T781]  ? rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553349][  T781]  ? __warn+0x9e/0x15f
[  109.553354][  T781]  ? report_bug+0xe8/0x14a
[  109.553357][  T781]  ? rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553364][  T781]  ? exc_overflow+0x37/0x37
[  109.553367][  T781]  ? handle_bug+0x3a/0x55
[  109.553369][  T781]  ? exc_invalid_op+0x1a/0x56
[  109.553372][  T781]  ? handle_exception+0x148/0x148
[  109.553376][  T781]  ? osq_wait_next+0x18/0x41
[  109.553379][  T781]  ? exc_overflow+0x37/0x37
[  109.553381][  T781]  ? rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553388][  T781]  ? exc_overflow+0x37/0x37
[  109.553390][  T781]  ? rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553399][  T781]  rcutorture_one_extend+0x18c/0x3c1 [rcutorture]
[  109.553410][  T781]  rcu_torture_one_read+0x95/0x4d2 [rcutorture]
[  109.553417][  T781]  ? validate_chain+0x3d/0x24c
[  109.553420][  T781]  ? mark_lock+0x6a/0x14d
[  109.553440][  T781]  rcu_torture_reader+0xc4/0xdbd [rcutorture]
[  109.553448][  T781]  ? rcu_torture_one_read+0x4d2/0x4d2 [rcutorture]
[  109.553457][  T781]  kthread+0x169/0x16e
[  109.553459][  T781]  ? rcu_torture_read_exit_child+0x3a/0x3a [rcutorture]
[  109.553466][  T781]  ? kthread_is_per_cpu+0x17/0x17
[  109.553468][  T781]  ret_from_fork+0x19/0x2c
[  109.553471][  T781]  ? kthread_is_per_cpu+0x17/0x17
[  109.553472][  T781]  ret_from_fork_asm+0x12/0x20
[  109.553475][  T781]  entry_INT80_32+0x108/0x108
[  109.553481][  T781] irq event stamp: 307
[  109.553482][  T781] hardirqs last  enabled at (313): [<94ebb6cb>] console_trylock_spinning+0x6b/0x10a
[  109.553485][  T781] hardirqs last disabled at (318): [<94ebb691>] console_trylock_spinning+0x31/0x10a
[  109.553486][  T781] softirqs last  enabled at (0): [<94e613c4>] copy_process+0x945/0x1a7d
[  109.553489][  T781] softirqs last disabled at (0): [<00000000>] 0x0
[  109.553491][  T781] ---[ end trace 0000000000000000 ]---
[  109.553494][  T781] ------------[ cut here ]------------
[  109.553496][  T781] rcutorture_one_extend_check after change: Current 0x60  To add 0x60  To remove 0x4  preempt_count() 0x2
[  109.553510][  T781] WARNING: CPU: 1 PID: 781 at kernel/rcu/rcutorture.c:1902 rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553517][  T781] Modules linked in: rcutorture(+) torture
[  109.553520][  T781] CPU: 1 UID: 0 PID: 781 Comm: rcu_torture_rea Tainted: G        W       T  6.14.0-rc1-00007-gc9b55f9da0d2 #1
[  109.553523][  T781] Tainted: [W]=WARN, [T]=RANDSTRUCT
[  109.553524][  T781] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
[  109.553525][  T781] EIP: rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553530][  T781] Code: 3d fe 04 1c f1 00 75 27 25 ff ff ff 7f c6 05 fe 04 1c f1 01 50 ff 75 08 57 53 56 68 60 9f 1c f1 68 a4 74 1c f1 e8 da d3 ca a3 <0f> 0b 83 c4 1c a1 40 09 1c f1 8b 40 1c 85 c0 74 41 f6 c3 60 75 3c
[  109.553532][  T781] EAX: 00000067 EBX: 00000060 ECX: 00000027 EDX: e89c1a00
[  109.553533][  T781] ESI: f11c936d EDI: 00000060 EBP: 825d1d88 ESP: 825d1d54
[  109.553535][  T781] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 EFLAGS: 00010282
[  109.553537][  T781] CR0: 80050033 CR2: 77235000 CR3: 010c5000 CR4: 00040690
[  109.553539][  T781] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
[  109.553540][  T781] DR6: fffe0ff0 DR7: 00000400
[  109.553541][  T781] Call Trace:
[  109.553543][  T781]  ? show_regs+0x4c/0x52
[  109.553545][  T781]  ? rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553551][  T781]  ? __warn+0x9e/0x15f
[  109.553555][  T781]  ? report_bug+0xe8/0x14a
[  109.553558][  T781]  ? rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553565][  T781]  ? exc_overflow+0x37/0x37
[  109.553567][  T781]  ? handle_bug+0x3a/0x55
[  109.553569][  T781]  ? exc_invalid_op+0x1a/0x56
[  109.553572][  T781]  ? handle_exception+0x148/0x148
[  109.553575][  T781]  ? osq_wait_next+0x18/0x41
[  109.553578][  T781]  ? exc_overflow+0x37/0x37
[  109.553580][  T781]  ? rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553587][  T781]  ? exc_overflow+0x37/0x37
[  109.553589][  T781]  ? rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553599][  T781]  rcutorture_one_extend+0x3b7/0x3c1 [rcutorture]
[  109.553610][  T781]  rcu_torture_one_read+0x21b/0x4d2 [rcutorture]
[  109.553638][  T781]  rcu_torture_reader+0xc4/0xdbd [rcutorture]
[  109.553646][  T781]  ? rcu_torture_one_read+0x4d2/0x4d2 [rcutorture]
[  109.553655][  T781]  kthread+0x169/0x16e
[  109.553658][  T781]  ? rcu_torture_read_exit_child+0x3a/0x3a [rcutorture]
[  109.553664][  T781]  ? kthread_is_per_cpu+0x17/0x17
[  109.553667][  T781]  ret_from_fork+0x19/0x2c
[  109.553669][  T781]  ? kthread_is_per_cpu+0x17/0x17
[  109.553671][  T781]  ret_from_fork_asm+0x12/0x20
[  109.553673][  T781]  entry_INT80_32+0x108/0x108
[  109.553679][  T781] irq event stamp: 607
Quoted 8 lines
[  109.553680][  T781] hardirqs last  enabled at (613): [<94ebb6cb>] console_trylock_spinning+0x6b/0x10a
[  109.553682][  T781] hardirqs last disabled at (618): [<94ebb691>] console_trylock_spinning+0x31/0x10a
[  109.553684][  T781] softirqs last  enabled at (0): [<94e613c4>] copy_process+0x945/0x1a7d
[  109.553686][  T781] softirqs last disabled at (0): [<00000000>] 0x0
[  109.553688][  T781] ---[ end trace 0000000000000000 ]---
[  109.634034][  T769] rcu-torture: Creating torture_shuffle task
[  109.635952][  T782] rcu-torture: rcu_torture_stats task started
[  109.637994][  T769] rcu-torture: Creating torture_stutter task

And rcutorture's WARN_ON() has a bug that is exposed by that change in Kconfig option. Does the patch shown below help?

Either way, thank you for your testing efforts!

Thanx, Paul

------------------------------------------------------------------------

commit bb638fe1a683316397d5517cb7d1797d70d21c86

Author: Paul E. McKenney <[email protected]>
Date:   Wed Feb 19 08:41:11 2025 -0800

rcutorture: Update rcutorture_one_extend_check() for lazy preemption

The rcutorture_one_extend_check() function's last check assumes that if cur_ops->readlock_nesting() returns greater than zero, either the RCUTORTURE_RDR_RCU_1 or the RCUTORTURE_RDR_RCU_2 bit must be set, that is, there must be at least one rcu_read_lock() in effect.

This works for preemptible RCU and for non-preemptible RCU running in a non-preemptible kernel. But it fails for non-preemptible RCU running in a preemptible kernel because then RCU's cur_ops->readlock_nesting() function, which is rcu_torture_readlock_nesting(), will return the PREEMPT_MASK mask bits from preempt_count(). The result will be greater than zero if preemption is disabled, including by the RCUTORTURE_RDR_PREEMPT and RCUTORTURE_RDR_SCHED bits.

This commit therefore adjusts this check to take into account the case fo non-preemptible RCU running in a preemptible kernel.

kernel/rcu/rcutorture.c +6 -2
index 895a27545ae1e..0f446ff04eda1 100644
@@ -1981,6 +1981,8 @@ static void rcu_torture_reader_do_mbchk(long myid, struct rcu_torture *rtp,
 #define ROEC_ARGS "%s %s: Current %#x  To add %#x  To remove %#x  preempt_count() %#x\n", __func__, s, curstate, new, old, preempt_count()
 static void rcutorture_one_extend_check(char *s, int curstate, int new, int old, bool insoftirq)
 {
+	int mask;
+
 	if (!IS_ENABLED(CONFIG_RCU_TORTURE_TEST_CHK_RDR_STATE))
 		return;
 
@@ -2010,8 +2012,10 @@ static void rcutorture_one_extend_check(char *s, int curstate, int new, int old,
 	WARN_ONCE(cur_ops->extendables &&
 		  !(curstate & (RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED)) &&
 		  (preempt_count() & PREEMPT_MASK), ROEC_ARGS);
-	WARN_ONCE(cur_ops->readlock_nesting &&
-		  !(curstate & (RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2)) &&
+	mask = RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2;
+	if (IS_ENABLED(CONFIG_PREEMPT_RCU))
+		mask |= RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED;
+	WARN_ONCE(cur_ops->readlock_nesting && !(curstate & mask) &&
 		  cur_ops->readlock_nesting() > 0, ROEC_ARGS);
 }
 
#2 lore raw
Quoted 182 lines · Paul E. McKenney
Quoted 169 lines · kernel test robot

hi, Ankur Arora and all,

this is not a regression report as our bot normally does. this report is just FYI that we observe a WARNING with this config, in case it could supply any useful information and/or somebody wants to have a look.

by this change, the config has below diff with parent:

==================== PARENT FIRST_BAD KCONFIGS f001b7165def8f7af6ce95d08f0e1bbc2442654d ====================

pkg/linux/i386-randconfig-r121-20250212/gcc-12/c9b55f9da0d2c72c8c8d8cd5df84af5251b74283/.config 2025-02-13 08:43:08.186415593 +0800 renamed from pkg/linux/i386-randconfig-r121-20250212/gcc-12/f001b7165def8f7af6ce95d08f0e1bbc2442654d/.config 2025-02-13 07:56:33.420457682 +0800 +0 -2
@@ -147,7 +147,6 @@ CONFIG_BSD_PROCESS_ACCT=y
 # RCU Subsystem
 #
 CONFIG_TREE_RCU=y
-CONFIG_PREEMPT_RCU=y
 CONFIG_RCU_EXPERT=y
 CONFIG_TREE_SRCU=y
 CONFIG_TASKS_RCU_GENERIC=y
@@ -162,7 +161,6 @@ CONFIG_RCU_STALL_COMMON=y
 CONFIG_RCU_NEED_SEGCBLIST=y
 CONFIG_RCU_FANOUT=32
 CONFIG_RCU_FANOUT_LEAF=16
-# CONFIG_RCU_BOOST is not set
 # CONFIG_RCU_NOCB_CPU is not set
 # CONFIG_TASKS_TRACE_RCU_READ_MB is not set
 # CONFIG_RCU_DOUBLE_CHECK_CB_TIME is not set

below is full report.

Hello,

kernel test robot noticed "WARNING:at_kernel/rcu/rcutorture.c:#rcutorture_one_extend_check[rcutorture]" on:

commit: c9b55f9da0d2c72c8c8d8cd5df84af5251b74283 ("rcu: limit PREEMPT_RCU configurations")
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master

[test failed on linux-next/master c674aa7c289e51659e40dda0f954886ef7f80042]

in testcase: rcutorture
version:
with following parameters:

	runtime: 300s
	test: cpuhotplug
	torture_type: rcu

config: i386-randconfig-r121-20250212
compiler: gcc-12
test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 16G

(please refer to attached dmesg/kmsg for entire log/backtrace)

+-----------------------------------------------------------------------------+------------+------------+
|                                                                             | f001b7165d | c9b55f9da0 |
+-----------------------------------------------------------------------------+------------+------------+
| WARNING:at_kernel/rcu/rcutorture.c:#rcutorture_one_extend_check[rcutorture] | 0          | 12         |
| EIP:rcutorture_one_extend_check                                             | 0          | 12         |
+-----------------------------------------------------------------------------+------------+------------+

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-lkp/[email protected]

The kernel config and materials to reproduce are available at:
https://download.01.org/0day-ci/archive/20250217/[email protected]

[  109.553253][  T781] rcu-torture: rcu_torture_reader task started
[  109.553258][  T781] ------------[ cut here ]------------
[  109.553259][  T781] rcutorture_one_extend_check during change: Current 0x4  To add 0x4  To remove 0x0  preempt_count() 0x1
[  109.553292][  T781] WARNING: CPU: 1 PID: 781 at kernel/rcu/rcutorture.c:1905 rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553302][  T781] Modules linked in: rcutorture(+) torture
[  109.553307][  T781] CPU: 1 UID: 0 PID: 781 Comm: rcu_torture_rea Tainted: G                T  6.14.0-rc1-00007-gc9b55f9da0d2 #1
[  109.553310][  T781] Tainted: [T]=RANDSTRUCT
[  109.553311][  T781] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
[  109.553312][  T781] EIP: rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553318][  T781] Code: 75 2d c6 05 fd 04 1c f1 01 64 a1 84 77 7c 97 25 ff ff ff 7f 50 ff 75 08 57 53 56 68 60 9f 1c f1 68 a4 74 1c f1 e8 8d d3 ca a3 <0f> 0b 83 c4 1c 8d 65 f4 5b 5e 5f 5d c3 55 31 d2 83 f8 1f 89 e5 53
[  109.553320][  T781] EAX: 00000066 EBX: 00000004 ECX: 00000027 EDX: e89c1a00
[  109.553322][  T781] ESI: f11c92d9 EDI: 00000004 EBP: 825d1d88 ESP: 825d1d54
[  109.553323][  T781] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 EFLAGS: 00010282
[  109.553327][  T781] CR0: 80050033 CR2: 77235000 CR3: 010c5000 CR4: 00040690
[  109.553328][  T781] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
[  109.553330][  T781] DR6: fffe0ff0 DR7: 00000400
[  109.553331][  T781] Call Trace:
[  109.553333][  T781]  ? show_regs+0x4c/0x52
[  109.553343][  T781]  ? rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553349][  T781]  ? __warn+0x9e/0x15f
[  109.553354][  T781]  ? report_bug+0xe8/0x14a
[  109.553357][  T781]  ? rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553364][  T781]  ? exc_overflow+0x37/0x37
[  109.553367][  T781]  ? handle_bug+0x3a/0x55
[  109.553369][  T781]  ? exc_invalid_op+0x1a/0x56
[  109.553372][  T781]  ? handle_exception+0x148/0x148
[  109.553376][  T781]  ? osq_wait_next+0x18/0x41
[  109.553379][  T781]  ? exc_overflow+0x37/0x37
[  109.553381][  T781]  ? rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553388][  T781]  ? exc_overflow+0x37/0x37
[  109.553390][  T781]  ? rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553399][  T781]  rcutorture_one_extend+0x18c/0x3c1 [rcutorture]
[  109.553410][  T781]  rcu_torture_one_read+0x95/0x4d2 [rcutorture]
[  109.553417][  T781]  ? validate_chain+0x3d/0x24c
[  109.553420][  T781]  ? mark_lock+0x6a/0x14d
[  109.553440][  T781]  rcu_torture_reader+0xc4/0xdbd [rcutorture]
[  109.553448][  T781]  ? rcu_torture_one_read+0x4d2/0x4d2 [rcutorture]
[  109.553457][  T781]  kthread+0x169/0x16e
[  109.553459][  T781]  ? rcu_torture_read_exit_child+0x3a/0x3a [rcutorture]
[  109.553466][  T781]  ? kthread_is_per_cpu+0x17/0x17
[  109.553468][  T781]  ret_from_fork+0x19/0x2c
[  109.553471][  T781]  ? kthread_is_per_cpu+0x17/0x17
[  109.553472][  T781]  ret_from_fork_asm+0x12/0x20
[  109.553475][  T781]  entry_INT80_32+0x108/0x108
[  109.553481][  T781] irq event stamp: 307
[  109.553482][  T781] hardirqs last  enabled at (313): [<94ebb6cb>] console_trylock_spinning+0x6b/0x10a
[  109.553485][  T781] hardirqs last disabled at (318): [<94ebb691>] console_trylock_spinning+0x31/0x10a
[  109.553486][  T781] softirqs last  enabled at (0): [<94e613c4>] copy_process+0x945/0x1a7d
[  109.553489][  T781] softirqs last disabled at (0): [<00000000>] 0x0
[  109.553491][  T781] ---[ end trace 0000000000000000 ]---
[  109.553494][  T781] ------------[ cut here ]------------
[  109.553496][  T781] rcutorture_one_extend_check after change: Current 0x60  To add 0x60  To remove 0x4  preempt_count() 0x2
[  109.553510][  T781] WARNING: CPU: 1 PID: 781 at kernel/rcu/rcutorture.c:1902 rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553517][  T781] Modules linked in: rcutorture(+) torture
[  109.553520][  T781] CPU: 1 UID: 0 PID: 781 Comm: rcu_torture_rea Tainted: G        W       T  6.14.0-rc1-00007-gc9b55f9da0d2 #1
[  109.553523][  T781] Tainted: [W]=WARN, [T]=RANDSTRUCT
[  109.553524][  T781] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
[  109.553525][  T781] EIP: rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553530][  T781] Code: 3d fe 04 1c f1 00 75 27 25 ff ff ff 7f c6 05 fe 04 1c f1 01 50 ff 75 08 57 53 56 68 60 9f 1c f1 68 a4 74 1c f1 e8 da d3 ca a3 <0f> 0b 83 c4 1c a1 40 09 1c f1 8b 40 1c 85 c0 74 41 f6 c3 60 75 3c
[  109.553532][  T781] EAX: 00000067 EBX: 00000060 ECX: 00000027 EDX: e89c1a00
[  109.553533][  T781] ESI: f11c936d EDI: 00000060 EBP: 825d1d88 ESP: 825d1d54
[  109.553535][  T781] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 EFLAGS: 00010282
[  109.553537][  T781] CR0: 80050033 CR2: 77235000 CR3: 010c5000 CR4: 00040690
[  109.553539][  T781] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
[  109.553540][  T781] DR6: fffe0ff0 DR7: 00000400
[  109.553541][  T781] Call Trace:
[  109.553543][  T781]  ? show_regs+0x4c/0x52
[  109.553545][  T781]  ? rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553551][  T781]  ? __warn+0x9e/0x15f
[  109.553555][  T781]  ? report_bug+0xe8/0x14a
[  109.553558][  T781]  ? rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553565][  T781]  ? exc_overflow+0x37/0x37
[  109.553567][  T781]  ? handle_bug+0x3a/0x55
[  109.553569][  T781]  ? exc_invalid_op+0x1a/0x56
[  109.553572][  T781]  ? handle_exception+0x148/0x148
[  109.553575][  T781]  ? osq_wait_next+0x18/0x41
[  109.553578][  T781]  ? exc_overflow+0x37/0x37
[  109.553580][  T781]  ? rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553587][  T781]  ? exc_overflow+0x37/0x37
[  109.553589][  T781]  ? rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553599][  T781]  rcutorture_one_extend+0x3b7/0x3c1 [rcutorture]
[  109.553610][  T781]  rcu_torture_one_read+0x21b/0x4d2 [rcutorture]
[  109.553638][  T781]  rcu_torture_reader+0xc4/0xdbd [rcutorture]
[  109.553646][  T781]  ? rcu_torture_one_read+0x4d2/0x4d2 [rcutorture]
[  109.553655][  T781]  kthread+0x169/0x16e
[  109.553658][  T781]  ? rcu_torture_read_exit_child+0x3a/0x3a [rcutorture]
[  109.553664][  T781]  ? kthread_is_per_cpu+0x17/0x17
[  109.553667][  T781]  ret_from_fork+0x19/0x2c
[  109.553669][  T781]  ? kthread_is_per_cpu+0x17/0x17
[  109.553671][  T781]  ret_from_fork_asm+0x12/0x20
[  109.553673][  T781]  entry_INT80_32+0x108/0x108
[  109.553679][  T781] irq event stamp: 607
Quoted 8 lines
[  109.553680][  T781] hardirqs last  enabled at (613): [<94ebb6cb>] console_trylock_spinning+0x6b/0x10a
[  109.553682][  T781] hardirqs last disabled at (618): [<94ebb691>] console_trylock_spinning+0x31/0x10a
[  109.553684][  T781] softirqs last  enabled at (0): [<94e613c4>] copy_process+0x945/0x1a7d
[  109.553686][  T781] softirqs last disabled at (0): [<00000000>] 0x0
[  109.553688][  T781] ---[ end trace 0000000000000000 ]---
[  109.634034][  T769] rcu-torture: Creating torture_shuffle task
[  109.635952][  T782] rcu-torture: rcu_torture_stats task started
[  109.637994][  T769] rcu-torture: Creating torture_stutter task

And rcutorture's WARN_ON() has a bug that is exposed by that change in Kconfig option. Does the patch shown below help?

Quoted 2 lines

Either way, thank you for your testing efforts!

Thanks! I put it in the topic branch (and update the next branch of rcu repo) for the upcoming PR (right before commit "rcu: limit PREEMPT_RCU configurations"), unfortunately I cannot reproduce the issue, maybe kernel test robot can help confirm it?

Regards,
Boqun

Quoted 61 lines

Thanx, Paul

------------------------------------------------------------------------

commit bb638fe1a683316397d5517cb7d1797d70d21c86

Author: Paul E. McKenney <[email protected]>
Date:   Wed Feb 19 08:41:11 2025 -0800

rcutorture: Update rcutorture_one_extend_check() for lazy preemption

The rcutorture_one_extend_check() function's last check assumes that if cur_ops->readlock_nesting() returns greater than zero, either the RCUTORTURE_RDR_RCU_1 or the RCUTORTURE_RDR_RCU_2 bit must be set, that is, there must be at least one rcu_read_lock() in effect.

This works for preemptible RCU and for non-preemptible RCU running in a non-preemptible kernel. But it fails for non-preemptible RCU running in a preemptible kernel because then RCU's cur_ops->readlock_nesting() function, which is rcu_torture_readlock_nesting(), will return the PREEMPT_MASK mask bits from preempt_count(). The result will be greater than zero if preemption is disabled, including by the RCUTORTURE_RDR_PREEMPT and RCUTORTURE_RDR_SCHED bits.

This commit therefore adjusts this check to take into account the case fo non-preemptible RCU running in a preemptible kernel.

kernel/rcu/rcutorture.c +6 -2
index 895a27545ae1e..0f446ff04eda1 100644
@@ -1981,6 +1981,8 @@ static void rcu_torture_reader_do_mbchk(long myid, struct rcu_torture *rtp,
 #define ROEC_ARGS "%s %s: Current %#x  To add %#x  To remove %#x  preempt_count() %#x\n", __func__, s, curstate, new, old, preempt_count()
 static void rcutorture_one_extend_check(char *s, int curstate, int new, int old, bool insoftirq)
 {
+	int mask;
+
 	if (!IS_ENABLED(CONFIG_RCU_TORTURE_TEST_CHK_RDR_STATE))
 		return;
 
@@ -2010,8 +2012,10 @@ static void rcutorture_one_extend_check(char *s, int curstate, int new, int old,
 	WARN_ONCE(cur_ops->extendables &&
 		  !(curstate & (RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED)) &&
 		  (preempt_count() & PREEMPT_MASK), ROEC_ARGS);
-	WARN_ONCE(cur_ops->readlock_nesting &&
-		  !(curstate & (RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2)) &&
+	mask = RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2;
+	if (IS_ENABLED(CONFIG_PREEMPT_RCU))
+		mask |= RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED;
+	WARN_ONCE(cur_ops->readlock_nesting && !(curstate & mask) &&
 		  cur_ops->readlock_nesting() > 0, ROEC_ARGS);
 }
 
#3 lore raw
In reply to Paul E. McKenney

hi, Paul,

Quoted 173 lines · Paul E. McKenney
Quoted 172 lines · kernel test robot

hi, Ankur Arora and all,

this is not a regression report as our bot normally does. this report is just FYI that we observe a WARNING with this config, in case it could supply any useful information and/or somebody wants to have a look.

by this change, the config has below diff with parent:

==================== PARENT FIRST_BAD KCONFIGS f001b7165def8f7af6ce95d08f0e1bbc2442654d ====================

pkg/linux/i386-randconfig-r121-20250212/gcc-12/c9b55f9da0d2c72c8c8d8cd5df84af5251b74283/.config 2025-02-13 08:43:08.186415593 +0800 renamed from pkg/linux/i386-randconfig-r121-20250212/gcc-12/f001b7165def8f7af6ce95d08f0e1bbc2442654d/.config 2025-02-13 07:56:33.420457682 +0800 +0 -2
@@ -147,7 +147,6 @@ CONFIG_BSD_PROCESS_ACCT=y
 # RCU Subsystem
 #
 CONFIG_TREE_RCU=y
-CONFIG_PREEMPT_RCU=y
 CONFIG_RCU_EXPERT=y
 CONFIG_TREE_SRCU=y
 CONFIG_TASKS_RCU_GENERIC=y
@@ -162,7 +161,6 @@ CONFIG_RCU_STALL_COMMON=y
 CONFIG_RCU_NEED_SEGCBLIST=y
 CONFIG_RCU_FANOUT=32
 CONFIG_RCU_FANOUT_LEAF=16
-# CONFIG_RCU_BOOST is not set
 # CONFIG_RCU_NOCB_CPU is not set
 # CONFIG_TASKS_TRACE_RCU_READ_MB is not set
 # CONFIG_RCU_DOUBLE_CHECK_CB_TIME is not set

below is full report.

Hello,

kernel test robot noticed "WARNING:at_kernel/rcu/rcutorture.c:#rcutorture_one_extend_check[rcutorture]" on:

commit: c9b55f9da0d2c72c8c8d8cd5df84af5251b74283 ("rcu: limit PREEMPT_RCU configurations")
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master

[test failed on linux-next/master c674aa7c289e51659e40dda0f954886ef7f80042]

in testcase: rcutorture
version:
with following parameters:

	runtime: 300s
	test: cpuhotplug
	torture_type: rcu

config: i386-randconfig-r121-20250212
compiler: gcc-12
test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 16G

(please refer to attached dmesg/kmsg for entire log/backtrace)

+-----------------------------------------------------------------------------+------------+------------+
|                                                                             | f001b7165d | c9b55f9da0 |
+-----------------------------------------------------------------------------+------------+------------+
| WARNING:at_kernel/rcu/rcutorture.c:#rcutorture_one_extend_check[rcutorture] | 0          | 12         |
| EIP:rcutorture_one_extend_check                                             | 0          | 12         |
+-----------------------------------------------------------------------------+------------+------------+

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-lkp/[email protected]

The kernel config and materials to reproduce are available at:
https://download.01.org/0day-ci/archive/20250217/[email protected]

[  109.553253][  T781] rcu-torture: rcu_torture_reader task started
[  109.553258][  T781] ------------[ cut here ]------------
[  109.553259][  T781] rcutorture_one_extend_check during change: Current 0x4  To add 0x4  To remove 0x0  preempt_count() 0x1
[  109.553292][  T781] WARNING: CPU: 1 PID: 781 at kernel/rcu/rcutorture.c:1905 rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553302][  T781] Modules linked in: rcutorture(+) torture
[  109.553307][  T781] CPU: 1 UID: 0 PID: 781 Comm: rcu_torture_rea Tainted: G                T  6.14.0-rc1-00007-gc9b55f9da0d2 #1
[  109.553310][  T781] Tainted: [T]=RANDSTRUCT
[  109.553311][  T781] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
[  109.553312][  T781] EIP: rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553318][  T781] Code: 75 2d c6 05 fd 04 1c f1 01 64 a1 84 77 7c 97 25 ff ff ff 7f 50 ff 75 08 57 53 56 68 60 9f 1c f1 68 a4 74 1c f1 e8 8d d3 ca a3 <0f> 0b 83 c4 1c 8d 65 f4 5b 5e 5f 5d c3 55 31 d2 83 f8 1f 89 e5 53
[  109.553320][  T781] EAX: 00000066 EBX: 00000004 ECX: 00000027 EDX: e89c1a00
[  109.553322][  T781] ESI: f11c92d9 EDI: 00000004 EBP: 825d1d88 ESP: 825d1d54
[  109.553323][  T781] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 EFLAGS: 00010282
[  109.553327][  T781] CR0: 80050033 CR2: 77235000 CR3: 010c5000 CR4: 00040690
[  109.553328][  T781] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
[  109.553330][  T781] DR6: fffe0ff0 DR7: 00000400
[  109.553331][  T781] Call Trace:
[  109.553333][  T781]  ? show_regs+0x4c/0x52
[  109.553343][  T781]  ? rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553349][  T781]  ? __warn+0x9e/0x15f
[  109.553354][  T781]  ? report_bug+0xe8/0x14a
[  109.553357][  T781]  ? rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553364][  T781]  ? exc_overflow+0x37/0x37
[  109.553367][  T781]  ? handle_bug+0x3a/0x55
[  109.553369][  T781]  ? exc_invalid_op+0x1a/0x56
[  109.553372][  T781]  ? handle_exception+0x148/0x148
[  109.553376][  T781]  ? osq_wait_next+0x18/0x41
[  109.553379][  T781]  ? exc_overflow+0x37/0x37
[  109.553381][  T781]  ? rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553388][  T781]  ? exc_overflow+0x37/0x37
[  109.553390][  T781]  ? rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553399][  T781]  rcutorture_one_extend+0x18c/0x3c1 [rcutorture]
[  109.553410][  T781]  rcu_torture_one_read+0x95/0x4d2 [rcutorture]
[  109.553417][  T781]  ? validate_chain+0x3d/0x24c
[  109.553420][  T781]  ? mark_lock+0x6a/0x14d
[  109.553440][  T781]  rcu_torture_reader+0xc4/0xdbd [rcutorture]
[  109.553448][  T781]  ? rcu_torture_one_read+0x4d2/0x4d2 [rcutorture]
[  109.553457][  T781]  kthread+0x169/0x16e
[  109.553459][  T781]  ? rcu_torture_read_exit_child+0x3a/0x3a [rcutorture]
[  109.553466][  T781]  ? kthread_is_per_cpu+0x17/0x17
[  109.553468][  T781]  ret_from_fork+0x19/0x2c
[  109.553471][  T781]  ? kthread_is_per_cpu+0x17/0x17
[  109.553472][  T781]  ret_from_fork_asm+0x12/0x20
[  109.553475][  T781]  entry_INT80_32+0x108/0x108
[  109.553481][  T781] irq event stamp: 307
[  109.553482][  T781] hardirqs last  enabled at (313): [<94ebb6cb>] console_trylock_spinning+0x6b/0x10a
[  109.553485][  T781] hardirqs last disabled at (318): [<94ebb691>] console_trylock_spinning+0x31/0x10a
[  109.553486][  T781] softirqs last  enabled at (0): [<94e613c4>] copy_process+0x945/0x1a7d
[  109.553489][  T781] softirqs last disabled at (0): [<00000000>] 0x0
[  109.553491][  T781] ---[ end trace 0000000000000000 ]---
[  109.553494][  T781] ------------[ cut here ]------------
[  109.553496][  T781] rcutorture_one_extend_check after change: Current 0x60  To add 0x60  To remove 0x4  preempt_count() 0x2
[  109.553510][  T781] WARNING: CPU: 1 PID: 781 at kernel/rcu/rcutorture.c:1902 rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553517][  T781] Modules linked in: rcutorture(+) torture
[  109.553520][  T781] CPU: 1 UID: 0 PID: 781 Comm: rcu_torture_rea Tainted: G        W       T  6.14.0-rc1-00007-gc9b55f9da0d2 #1
[  109.553523][  T781] Tainted: [W]=WARN, [T]=RANDSTRUCT
[  109.553524][  T781] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
[  109.553525][  T781] EIP: rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553530][  T781] Code: 3d fe 04 1c f1 00 75 27 25 ff ff ff 7f c6 05 fe 04 1c f1 01 50 ff 75 08 57 53 56 68 60 9f 1c f1 68 a4 74 1c f1 e8 da d3 ca a3 <0f> 0b 83 c4 1c a1 40 09 1c f1 8b 40 1c 85 c0 74 41 f6 c3 60 75 3c
[  109.553532][  T781] EAX: 00000067 EBX: 00000060 ECX: 00000027 EDX: e89c1a00
[  109.553533][  T781] ESI: f11c936d EDI: 00000060 EBP: 825d1d88 ESP: 825d1d54
[  109.553535][  T781] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 EFLAGS: 00010282
[  109.553537][  T781] CR0: 80050033 CR2: 77235000 CR3: 010c5000 CR4: 00040690
[  109.553539][  T781] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
[  109.553540][  T781] DR6: fffe0ff0 DR7: 00000400
[  109.553541][  T781] Call Trace:
[  109.553543][  T781]  ? show_regs+0x4c/0x52
[  109.553545][  T781]  ? rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553551][  T781]  ? __warn+0x9e/0x15f
[  109.553555][  T781]  ? report_bug+0xe8/0x14a
[  109.553558][  T781]  ? rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553565][  T781]  ? exc_overflow+0x37/0x37
[  109.553567][  T781]  ? handle_bug+0x3a/0x55
[  109.553569][  T781]  ? exc_invalid_op+0x1a/0x56
[  109.553572][  T781]  ? handle_exception+0x148/0x148
[  109.553575][  T781]  ? osq_wait_next+0x18/0x41
[  109.553578][  T781]  ? exc_overflow+0x37/0x37
[  109.553580][  T781]  ? rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553587][  T781]  ? exc_overflow+0x37/0x37
[  109.553589][  T781]  ? rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553599][  T781]  rcutorture_one_extend+0x3b7/0x3c1 [rcutorture]
[  109.553610][  T781]  rcu_torture_one_read+0x21b/0x4d2 [rcutorture]
[  109.553638][  T781]  rcu_torture_reader+0xc4/0xdbd [rcutorture]
[  109.553646][  T781]  ? rcu_torture_one_read+0x4d2/0x4d2 [rcutorture]
[  109.553655][  T781]  kthread+0x169/0x16e
[  109.553658][  T781]  ? rcu_torture_read_exit_child+0x3a/0x3a [rcutorture]
[  109.553664][  T781]  ? kthread_is_per_cpu+0x17/0x17
[  109.553667][  T781]  ret_from_fork+0x19/0x2c
[  109.553669][  T781]  ? kthread_is_per_cpu+0x17/0x17
[  109.553671][  T781]  ret_from_fork_asm+0x12/0x20
[  109.553673][  T781]  entry_INT80_32+0x108/0x108
[  109.553679][  T781] irq event stamp: 607
[  109.553680][  T781] hardirqs last  enabled at (613): [<94ebb6cb>] console_trylock_spinning+0x6b/0x10a
[  109.553682][  T781] hardirqs last disabled at (618): [<94ebb691>] console_trylock_spinning+0x31/0x10a
[  109.553684][  T781] softirqs last  enabled at (0): [<94e613c4>] copy_process+0x945/0x1a7d
Quoted 8 lines
Quoted 5 lines
[  109.553686][  T781] softirqs last disabled at (0): [<00000000>] 0x0
[  109.553688][  T781] ---[ end trace 0000000000000000 ]---
[  109.634034][  T769] rcu-torture: Creating torture_shuffle task
[  109.635952][  T782] rcu-torture: rcu_torture_stats task started
[  109.637994][  T769] rcu-torture: Creating torture_stutter task

And rcutorture's WARN_ON() has a bug that is exposed by that change in Kconfig option. Does the patch shown below help?

the patch does not fix the WARNING in our tests. attached one dmesg FYI.

Quoted 64 lines

Either way, thank you for your testing efforts!

Thanx, Paul

------------------------------------------------------------------------

commit bb638fe1a683316397d5517cb7d1797d70d21c86

Author: Paul E. McKenney <[email protected]>
Date:   Wed Feb 19 08:41:11 2025 -0800

rcutorture: Update rcutorture_one_extend_check() for lazy preemption

The rcutorture_one_extend_check() function's last check assumes that if cur_ops->readlock_nesting() returns greater than zero, either the RCUTORTURE_RDR_RCU_1 or the RCUTORTURE_RDR_RCU_2 bit must be set, that is, there must be at least one rcu_read_lock() in effect.

This works for preemptible RCU and for non-preemptible RCU running in a non-preemptible kernel. But it fails for non-preemptible RCU running in a preemptible kernel because then RCU's cur_ops->readlock_nesting() function, which is rcu_torture_readlock_nesting(), will return the PREEMPT_MASK mask bits from preempt_count(). The result will be greater than zero if preemption is disabled, including by the RCUTORTURE_RDR_PREEMPT and RCUTORTURE_RDR_SCHED bits.

This commit therefore adjusts this check to take into account the case fo non-preemptible RCU running in a preemptible kernel.

kernel/rcu/rcutorture.c +6 -2
index 895a27545ae1e..0f446ff04eda1 100644
@@ -1981,6 +1981,8 @@ static void rcu_torture_reader_do_mbchk(long myid, struct rcu_torture *rtp,
 #define ROEC_ARGS "%s %s: Current %#x  To add %#x  To remove %#x  preempt_count() %#x\n", __func__, s, curstate, new, old, preempt_count()
 static void rcutorture_one_extend_check(char *s, int curstate, int new, int old, bool insoftirq)
 {
+	int mask;
+
 	if (!IS_ENABLED(CONFIG_RCU_TORTURE_TEST_CHK_RDR_STATE))
 		return;
 
@@ -2010,8 +2012,10 @@ static void rcutorture_one_extend_check(char *s, int curstate, int new, int old,
 	WARN_ONCE(cur_ops->extendables &&
 		  !(curstate & (RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED)) &&
 		  (preempt_count() & PREEMPT_MASK), ROEC_ARGS);
-	WARN_ONCE(cur_ops->readlock_nesting &&
-		  !(curstate & (RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2)) &&
+	mask = RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2;
+	if (IS_ENABLED(CONFIG_PREEMPT_RCU))
+		mask |= RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED;
+	WARN_ONCE(cur_ops->readlock_nesting && !(curstate & mask) &&
 		  cur_ops->readlock_nesting() > 0, ROEC_ARGS);
 }
 
maintainer
#4 lore raw
Quoted 185 lines · Oliver Sang

hi, Paul,

Quoted 173 lines · Paul E. McKenney
Quoted 172 lines · kernel test robot

hi, Ankur Arora and all,

this is not a regression report as our bot normally does. this report is just FYI that we observe a WARNING with this config, in case it could supply any useful information and/or somebody wants to have a look.

by this change, the config has below diff with parent:

==================== PARENT FIRST_BAD KCONFIGS f001b7165def8f7af6ce95d08f0e1bbc2442654d ====================

pkg/linux/i386-randconfig-r121-20250212/gcc-12/c9b55f9da0d2c72c8c8d8cd5df84af5251b74283/.config 2025-02-13 08:43:08.186415593 +0800 renamed from pkg/linux/i386-randconfig-r121-20250212/gcc-12/f001b7165def8f7af6ce95d08f0e1bbc2442654d/.config 2025-02-13 07:56:33.420457682 +0800 +0 -2
@@ -147,7 +147,6 @@ CONFIG_BSD_PROCESS_ACCT=y
 # RCU Subsystem
 #
 CONFIG_TREE_RCU=y
-CONFIG_PREEMPT_RCU=y
 CONFIG_RCU_EXPERT=y
 CONFIG_TREE_SRCU=y
 CONFIG_TASKS_RCU_GENERIC=y
@@ -162,7 +161,6 @@ CONFIG_RCU_STALL_COMMON=y
 CONFIG_RCU_NEED_SEGCBLIST=y
 CONFIG_RCU_FANOUT=32
 CONFIG_RCU_FANOUT_LEAF=16
-# CONFIG_RCU_BOOST is not set
 # CONFIG_RCU_NOCB_CPU is not set
 # CONFIG_TASKS_TRACE_RCU_READ_MB is not set
 # CONFIG_RCU_DOUBLE_CHECK_CB_TIME is not set

below is full report.

Hello,

kernel test robot noticed "WARNING:at_kernel/rcu/rcutorture.c:#rcutorture_one_extend_check[rcutorture]" on:

commit: c9b55f9da0d2c72c8c8d8cd5df84af5251b74283 ("rcu: limit PREEMPT_RCU configurations")
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master

[test failed on linux-next/master c674aa7c289e51659e40dda0f954886ef7f80042]

in testcase: rcutorture
version:
with following parameters:

	runtime: 300s
	test: cpuhotplug
	torture_type: rcu

config: i386-randconfig-r121-20250212
compiler: gcc-12
test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 16G

(please refer to attached dmesg/kmsg for entire log/backtrace)

+-----------------------------------------------------------------------------+------------+------------+
|                                                                             | f001b7165d | c9b55f9da0 |
+-----------------------------------------------------------------------------+------------+------------+
| WARNING:at_kernel/rcu/rcutorture.c:#rcutorture_one_extend_check[rcutorture] | 0          | 12         |
| EIP:rcutorture_one_extend_check                                             | 0          | 12         |
+-----------------------------------------------------------------------------+------------+------------+

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-lkp/[email protected]

The kernel config and materials to reproduce are available at:
https://download.01.org/0day-ci/archive/20250217/[email protected]

[  109.553253][  T781] rcu-torture: rcu_torture_reader task started
[  109.553258][  T781] ------------[ cut here ]------------
[  109.553259][  T781] rcutorture_one_extend_check during change: Current 0x4  To add 0x4  To remove 0x0  preempt_count() 0x1
[  109.553292][  T781] WARNING: CPU: 1 PID: 781 at kernel/rcu/rcutorture.c:1905 rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553302][  T781] Modules linked in: rcutorture(+) torture
[  109.553307][  T781] CPU: 1 UID: 0 PID: 781 Comm: rcu_torture_rea Tainted: G                T  6.14.0-rc1-00007-gc9b55f9da0d2 #1
[  109.553310][  T781] Tainted: [T]=RANDSTRUCT
[  109.553311][  T781] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
[  109.553312][  T781] EIP: rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553318][  T781] Code: 75 2d c6 05 fd 04 1c f1 01 64 a1 84 77 7c 97 25 ff ff ff 7f 50 ff 75 08 57 53 56 68 60 9f 1c f1 68 a4 74 1c f1 e8 8d d3 ca a3 <0f> 0b 83 c4 1c 8d 65 f4 5b 5e 5f 5d c3 55 31 d2 83 f8 1f 89 e5 53
[  109.553320][  T781] EAX: 00000066 EBX: 00000004 ECX: 00000027 EDX: e89c1a00
[  109.553322][  T781] ESI: f11c92d9 EDI: 00000004 EBP: 825d1d88 ESP: 825d1d54
[  109.553323][  T781] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 EFLAGS: 00010282
[  109.553327][  T781] CR0: 80050033 CR2: 77235000 CR3: 010c5000 CR4: 00040690
[  109.553328][  T781] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
[  109.553330][  T781] DR6: fffe0ff0 DR7: 00000400
[  109.553331][  T781] Call Trace:
[  109.553333][  T781]  ? show_regs+0x4c/0x52
[  109.553343][  T781]  ? rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553349][  T781]  ? __warn+0x9e/0x15f
[  109.553354][  T781]  ? report_bug+0xe8/0x14a
[  109.553357][  T781]  ? rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553364][  T781]  ? exc_overflow+0x37/0x37
[  109.553367][  T781]  ? handle_bug+0x3a/0x55
[  109.553369][  T781]  ? exc_invalid_op+0x1a/0x56
[  109.553372][  T781]  ? handle_exception+0x148/0x148
[  109.553376][  T781]  ? osq_wait_next+0x18/0x41
[  109.553379][  T781]  ? exc_overflow+0x37/0x37
[  109.553381][  T781]  ? rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553388][  T781]  ? exc_overflow+0x37/0x37
[  109.553390][  T781]  ? rcutorture_one_extend_check+0x25a/0x267 [rcutorture]
[  109.553399][  T781]  rcutorture_one_extend+0x18c/0x3c1 [rcutorture]
[  109.553410][  T781]  rcu_torture_one_read+0x95/0x4d2 [rcutorture]
[  109.553417][  T781]  ? validate_chain+0x3d/0x24c
[  109.553420][  T781]  ? mark_lock+0x6a/0x14d
[  109.553440][  T781]  rcu_torture_reader+0xc4/0xdbd [rcutorture]
[  109.553448][  T781]  ? rcu_torture_one_read+0x4d2/0x4d2 [rcutorture]
[  109.553457][  T781]  kthread+0x169/0x16e
[  109.553459][  T781]  ? rcu_torture_read_exit_child+0x3a/0x3a [rcutorture]
[  109.553466][  T781]  ? kthread_is_per_cpu+0x17/0x17
[  109.553468][  T781]  ret_from_fork+0x19/0x2c
[  109.553471][  T781]  ? kthread_is_per_cpu+0x17/0x17
[  109.553472][  T781]  ret_from_fork_asm+0x12/0x20
[  109.553475][  T781]  entry_INT80_32+0x108/0x108
[  109.553481][  T781] irq event stamp: 307
[  109.553482][  T781] hardirqs last  enabled at (313): [<94ebb6cb>] console_trylock_spinning+0x6b/0x10a
[  109.553485][  T781] hardirqs last disabled at (318): [<94ebb691>] console_trylock_spinning+0x31/0x10a
[  109.553486][  T781] softirqs last  enabled at (0): [<94e613c4>] copy_process+0x945/0x1a7d
[  109.553489][  T781] softirqs last disabled at (0): [<00000000>] 0x0
[  109.553491][  T781] ---[ end trace 0000000000000000 ]---
[  109.553494][  T781] ------------[ cut here ]------------
[  109.553496][  T781] rcutorture_one_extend_check after change: Current 0x60  To add 0x60  To remove 0x4  preempt_count() 0x2
[  109.553510][  T781] WARNING: CPU: 1 PID: 781 at kernel/rcu/rcutorture.c:1902 rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553517][  T781] Modules linked in: rcutorture(+) torture
[  109.553520][  T781] CPU: 1 UID: 0 PID: 781 Comm: rcu_torture_rea Tainted: G        W       T  6.14.0-rc1-00007-gc9b55f9da0d2 #1
[  109.553523][  T781] Tainted: [W]=WARN, [T]=RANDSTRUCT
[  109.553524][  T781] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
[  109.553525][  T781] EIP: rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553530][  T781] Code: 3d fe 04 1c f1 00 75 27 25 ff ff ff 7f c6 05 fe 04 1c f1 01 50 ff 75 08 57 53 56 68 60 9f 1c f1 68 a4 74 1c f1 e8 da d3 ca a3 <0f> 0b 83 c4 1c a1 40 09 1c f1 8b 40 1c 85 c0 74 41 f6 c3 60 75 3c
[  109.553532][  T781] EAX: 00000067 EBX: 00000060 ECX: 00000027 EDX: e89c1a00
[  109.553533][  T781] ESI: f11c936d EDI: 00000060 EBP: 825d1d88 ESP: 825d1d54
[  109.553535][  T781] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 EFLAGS: 00010282
[  109.553537][  T781] CR0: 80050033 CR2: 77235000 CR3: 010c5000 CR4: 00040690
[  109.553539][  T781] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
[  109.553540][  T781] DR6: fffe0ff0 DR7: 00000400
[  109.553541][  T781] Call Trace:
[  109.553543][  T781]  ? show_regs+0x4c/0x52
[  109.553545][  T781]  ? rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553551][  T781]  ? __warn+0x9e/0x15f
[  109.553555][  T781]  ? report_bug+0xe8/0x14a
[  109.553558][  T781]  ? rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553565][  T781]  ? exc_overflow+0x37/0x37
[  109.553567][  T781]  ? handle_bug+0x3a/0x55
[  109.553569][  T781]  ? exc_invalid_op+0x1a/0x56
[  109.553572][  T781]  ? handle_exception+0x148/0x148
[  109.553575][  T781]  ? osq_wait_next+0x18/0x41
[  109.553578][  T781]  ? exc_overflow+0x37/0x37
[  109.553580][  T781]  ? rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553587][  T781]  ? exc_overflow+0x37/0x37
[  109.553589][  T781]  ? rcutorture_one_extend_check+0x20d/0x267 [rcutorture]
[  109.553599][  T781]  rcutorture_one_extend+0x3b7/0x3c1 [rcutorture]
[  109.553610][  T781]  rcu_torture_one_read+0x21b/0x4d2 [rcutorture]
[  109.553638][  T781]  rcu_torture_reader+0xc4/0xdbd [rcutorture]
[  109.553646][  T781]  ? rcu_torture_one_read+0x4d2/0x4d2 [rcutorture]
[  109.553655][  T781]  kthread+0x169/0x16e
[  109.553658][  T781]  ? rcu_torture_read_exit_child+0x3a/0x3a [rcutorture]
[  109.553664][  T781]  ? kthread_is_per_cpu+0x17/0x17
[  109.553667][  T781]  ret_from_fork+0x19/0x2c
[  109.553669][  T781]  ? kthread_is_per_cpu+0x17/0x17
[  109.553671][  T781]  ret_from_fork_asm+0x12/0x20
[  109.553673][  T781]  entry_INT80_32+0x108/0x108
[  109.553679][  T781] irq event stamp: 607
[  109.553680][  T781] hardirqs last  enabled at (613): [<94ebb6cb>] console_trylock_spinning+0x6b/0x10a
[  109.553682][  T781] hardirqs last disabled at (618): [<94ebb691>] console_trylock_spinning+0x31/0x10a
[  109.553684][  T781] softirqs last  enabled at (0): [<94e613c4>] copy_process+0x945/0x1a7d
Quoted 8 lines
Quoted 5 lines
[  109.553686][  T781] softirqs last disabled at (0): [<00000000>] 0x0
[  109.553688][  T781] ---[ end trace 0000000000000000 ]---
[  109.634034][  T769] rcu-torture: Creating torture_shuffle task
[  109.635952][  T782] rcu-torture: rcu_torture_stats task started
[  109.637994][  T769] rcu-torture: Creating torture_stutter task

And rcutorture's WARN_ON() has a bug that is exposed by that change in Kconfig option. Does the patch shown below help?

Quoted 1 line

the patch does not fix the WARNING in our tests. attached one dmesg FYI.

Just to make sure that I understand, this patch was applied against this commit, correct?

c9b55f9da0d2 ("rcu: limit PREEMPT_RCU configurations")

I am guessing this based on this dmesg line:

 [  109.553307][  T781] CPU: 1 UID: 0 PID: 781 Comm: rcu_torture_rea Tainted: G                T  6.14.0-rc1-00007-gc9b55f9da0d2 #1

Is this really the case, or am I confused?

Thanx, Paul

Quoted 63 lines
Quoted 63 lines

Either way, thank you for your testing efforts!

Thanx, Paul

------------------------------------------------------------------------

commit bb638fe1a683316397d5517cb7d1797d70d21c86

Author: Paul E. McKenney <[email protected]>
Date:   Wed Feb 19 08:41:11 2025 -0800

rcutorture: Update rcutorture_one_extend_check() for lazy preemption

The rcutorture_one_extend_check() function's last check assumes that if cur_ops->readlock_nesting() returns greater than zero, either the RCUTORTURE_RDR_RCU_1 or the RCUTORTURE_RDR_RCU_2 bit must be set, that is, there must be at least one rcu_read_lock() in effect.

This works for preemptible RCU and for non-preemptible RCU running in a non-preemptible kernel. But it fails for non-preemptible RCU running in a preemptible kernel because then RCU's cur_ops->readlock_nesting() function, which is rcu_torture_readlock_nesting(), will return the PREEMPT_MASK mask bits from preempt_count(). The result will be greater than zero if preemption is disabled, including by the RCUTORTURE_RDR_PREEMPT and RCUTORTURE_RDR_SCHED bits.

This commit therefore adjusts this check to take into account the case fo non-preemptible RCU running in a preemptible kernel.

kernel/rcu/rcutorture.c +6 -2
index 895a27545ae1e..0f446ff04eda1 100644
@@ -1981,6 +1981,8 @@ static void rcu_torture_reader_do_mbchk(long myid, struct rcu_torture *rtp,
 #define ROEC_ARGS "%s %s: Current %#x  To add %#x  To remove %#x  preempt_count() %#x\n", __func__, s, curstate, new, old, preempt_count()
 static void rcutorture_one_extend_check(char *s, int curstate, int new, int old, bool insoftirq)
 {
+	int mask;
+
 	if (!IS_ENABLED(CONFIG_RCU_TORTURE_TEST_CHK_RDR_STATE))
 		return;
 
@@ -2010,8 +2012,10 @@ static void rcutorture_one_extend_check(char *s, int curstate, int new, int old,
 	WARN_ONCE(cur_ops->extendables &&
 		  !(curstate & (RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED)) &&
 		  (preempt_count() & PREEMPT_MASK), ROEC_ARGS);
-	WARN_ONCE(cur_ops->readlock_nesting &&
-		  !(curstate & (RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2)) &&
+	mask = RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2;
+	if (IS_ENABLED(CONFIG_PREEMPT_RCU))
+		mask |= RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED;
+	WARN_ONCE(cur_ops->readlock_nesting && !(curstate & mask) &&
 		  cur_ops->readlock_nesting() > 0, ROEC_ARGS);
 }
 
#5 lore raw

hi, Paul,

On Fri, Feb 21, 2025 at 05:02:51PM -0800, Paul E. McKenney wrote:

[...]

Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

And rcutorture's WARN_ON() has a bug that is exposed by that change in Kconfig option. Does the patch shown below help?

the patch does not fix the WARNING in our tests. attached one dmesg FYI.

Quoted 8 lines

Just to make sure that I understand, this patch was applied against this commit, correct?

c9b55f9da0d2 ("rcu: limit PREEMPT_RCU configurations")

I am guessing this based on this dmesg line:

 [  109.553307][  T781] CPU: 1 UID: 0 PID: 781 Comm: rcu_torture_rea Tainted: G                T  6.14.0-rc1-00007-gc9b55f9da0d2 #1

above line is not from the dmesg I attached in last mail. it's from
https://download.01.org/0day-ci/archive/20250217/[email protected]/dmesg.xz
which is for our original report.

Quoted 2 lines

Is this really the case, or am I confused?

we applied your patch as:

89519085afdf2 fix for c9b55f9da0 from Paul c9b55f9da0d2c rcu: limit PREEMPT_RCU configurations f001b7165def8 osnoise: provide quiescent states

so in the dmesg I attached in last mail (I attached it again in this mail):

[    0.000000][    T0] Linux version 6.14.0-rc1-00008-g89519085afdf (kbuild@9871be4fdbcc) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT Fri Feb 21 00:34:02 CST 2025
...
[  117.463907][  T812] CPU: 1 UID: 0 PID: 812 Comm: rcu_torture_rea Tainted: G                T  6.14.0-rc1-00008-g89519085afdf #1

the change of this 89519085afdf2 is as [1]

I'm not sure if it's better to upload dmesg for fix patch to
https://download.01.org/0day-ci/archive/20250217/[email protected]
again, so I did not do that. sorry if this causes confusion.

not sure if this is the correct applyment? thanks

[1]

kernel/rcu/rcutorture.c +6 -2
index d26fb1d33ed9a..de85a88810cf6 100644
@@ -1873,6 +1873,8 @@ static void rcu_torture_reader_do_mbchk(long myid, struct rcu_torture *rtp,
 #define ROEC_ARGS "%s %s: Current %#x  To add %#x  To remove %#x  preempt_count() %#x\n", __func__, s, curstate, new, old, preempt_count()
 static void rcutorture_one_extend_check(char *s, int curstate, int new, int old, bool insoftirq)
 {
+       int mask;
+
        if (!IS_ENABLED(CONFIG_RCU_TORTURE_TEST_CHK_RDR_STATE))
                return;
 
@@ -1902,8 +1904,10 @@ static void rcutorture_one_extend_check(char *s, int curstate, int new, int old,
        WARN_ONCE(cur_ops->extendables &&
                  !(curstate & (RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED)) &&
                  (preempt_count() & PREEMPT_MASK), ROEC_ARGS);
-       WARN_ONCE(cur_ops->readlock_nesting &&
-                 !(curstate & (RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2)) &&
+       mask = RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2;
+       if (IS_ENABLED(CONFIG_PREEMPT_RCU))
+               mask |= RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED;
+       WARN_ONCE(cur_ops->readlock_nesting && !(curstate & mask) &&
                  cur_ops->readlock_nesting() > 0, ROEC_ARGS);
 }
 
Quoted 68 lines

Thanx, Paul

Quoted 63 lines
Quoted 63 lines

Either way, thank you for your testing efforts!

Thanx, Paul

------------------------------------------------------------------------

commit bb638fe1a683316397d5517cb7d1797d70d21c86

Author: Paul E. McKenney <[email protected]>
Date:   Wed Feb 19 08:41:11 2025 -0800

rcutorture: Update rcutorture_one_extend_check() for lazy preemption

The rcutorture_one_extend_check() function's last check assumes that if cur_ops->readlock_nesting() returns greater than zero, either the RCUTORTURE_RDR_RCU_1 or the RCUTORTURE_RDR_RCU_2 bit must be set, that is, there must be at least one rcu_read_lock() in effect.

This works for preemptible RCU and for non-preemptible RCU running in a non-preemptible kernel. But it fails for non-preemptible RCU running in a preemptible kernel because then RCU's cur_ops->readlock_nesting() function, which is rcu_torture_readlock_nesting(), will return the PREEMPT_MASK mask bits from preempt_count(). The result will be greater than zero if preemption is disabled, including by the RCUTORTURE_RDR_PREEMPT and RCUTORTURE_RDR_SCHED bits.

This commit therefore adjusts this check to take into account the case fo non-preemptible RCU running in a preemptible kernel.

kernel/rcu/rcutorture.c +6 -2
index 895a27545ae1e..0f446ff04eda1 100644
@@ -1981,6 +1981,8 @@ static void rcu_torture_reader_do_mbchk(long myid, struct rcu_torture *rtp,
 #define ROEC_ARGS "%s %s: Current %#x  To add %#x  To remove %#x  preempt_count() %#x\n", __func__, s, curstate, new, old, preempt_count()
 static void rcutorture_one_extend_check(char *s, int curstate, int new, int old, bool insoftirq)
 {
+	int mask;
+
 	if (!IS_ENABLED(CONFIG_RCU_TORTURE_TEST_CHK_RDR_STATE))
 		return;
 
@@ -2010,8 +2012,10 @@ static void rcutorture_one_extend_check(char *s, int curstate, int new, int old,
 	WARN_ONCE(cur_ops->extendables &&
 		  !(curstate & (RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED)) &&
 		  (preempt_count() & PREEMPT_MASK), ROEC_ARGS);
-	WARN_ONCE(cur_ops->readlock_nesting &&
-		  !(curstate & (RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2)) &&
+	mask = RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2;
+	if (IS_ENABLED(CONFIG_PREEMPT_RCU))
+		mask |= RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED;
+	WARN_ONCE(cur_ops->readlock_nesting && !(curstate & mask) &&
 		  cur_ops->readlock_nesting() > 0, ROEC_ARGS);
 }
 
#6 lore raw

I finally find why I cannot reproduce this, I accidentally used next.2025.02.10a to build the kernel first, which has commit ("rcutorture: Move RCU_TORTURE_TEST_{CHK_RDR_STATE,LOG_CPU} to bool"), which changes Kconfig RCU_TORTURE_TEST_CHK_DRD_STATE into a bool and that disabled the test... (because config from you has it as =m).

Quoted 63 lines · Oliver Sang

hi, Paul,

On Fri, Feb 21, 2025 at 05:02:51PM -0800, Paul E. McKenney wrote:

[...]

Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

And rcutorture's WARN_ON() has a bug that is exposed by that change in Kconfig option. Does the patch shown below help?

the patch does not fix the WARNING in our tests. attached one dmesg FYI.

Quoted 8 lines

Just to make sure that I understand, this patch was applied against this commit, correct?

c9b55f9da0d2 ("rcu: limit PREEMPT_RCU configurations")

I am guessing this based on this dmesg line:

 [  109.553307][  T781] CPU: 1 UID: 0 PID: 781 Comm: rcu_torture_rea Tainted: G                T  6.14.0-rc1-00007-gc9b55f9da0d2 #1

above line is not from the dmesg I attached in last mail. it's from
https://download.01.org/0day-ci/archive/20250217/[email protected]/dmesg.xz
which is for our original report.

Quoted 2 lines

Is this really the case, or am I confused?

we applied your patch as:

89519085afdf2 fix for c9b55f9da0 from Paul c9b55f9da0d2c rcu: limit PREEMPT_RCU configurations f001b7165def8 osnoise: provide quiescent states

so in the dmesg I attached in last mail (I attached it again in this mail):

[    0.000000][    T0] Linux version 6.14.0-rc1-00008-g89519085afdf (kbuild@9871be4fdbcc) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT Fri Feb 21 00:34:02 CST 2025
...
[  117.463907][  T812] CPU: 1 UID: 0 PID: 812 Comm: rcu_torture_rea Tainted: G                T  6.14.0-rc1-00008-g89519085afdf #1

the change of this 89519085afdf2 is as [1]

I'm not sure if it's better to upload dmesg for fix patch to
https://download.01.org/0day-ci/archive/20250217/[email protected]
again, so I did not do that. sorry if this causes confusion.

not sure if this is the correct applyment? thanks

[1]

kernel/rcu/rcutorture.c +2 -0
index d26fb1d33ed9a..de85a88810cf6 100644
@@ -1873,6 +1873,8 @@ static void rcu_torture_reader_do_mbchk(long myid, struct rcu_torture *rtp,
 #define ROEC_ARGS "%s %s: Current %#x  To add %#x  To remove %#x  preempt_count() %#x\n", __func__, s, curstate, new, old, preempt_count()
 static void rcutorture_one_extend_check(char *s, int curstate, int new, int old, bool insoftirq)
 {
+       int mask;
+
        if (!IS_ENABLED(CONFIG_RCU_TORTURE_TEST_CHK_RDR_STATE))
                return;
 

kernel/rcu/rcutorture.c static void rcutorture_one_extend_check(char *s, int curstate, int new, int old, · line 1908

Quoted 7 lines
kernel/rcu/rcutorture.c +2 -2
@@ -1902,8 +1904,10 @@ static void rcutorture_one_extend_check(char *s, int curstate, int new, int old,
        WARN_ONCE(cur_ops->extendables &&
                  !(curstate & (RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED)) &&
                  (preempt_count() & PREEMPT_MASK), ROEC_ARGS);
-       WARN_ONCE(cur_ops->readlock_nesting &&
-                 !(curstate & (RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2)) &&
+       mask = RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2;
+       if (IS_ENABLED(CONFIG_PREEMPT_RCU))

Now look into this, I think this should be:

if (!IS_ENABLED(CONFIG_PREEMPT_RCU))

because:

* For preemptible RCU, ->readlock_nesting() will return
rcu_preempt_depth()

* For non-preemptible RCU, ->readlock_nesting() will return
preempt count.

, which means if RCUTORTURE_RDR_PREEMPT or RCUTORTURE_RDR_SCHED is in the curstate for *non-preemption RCU*, ->readlock_nesting() will be >0. That is, the "mask" needs to consider _PREEMPT and _SCHED for *non-preemption RCU*, not preemptible RCU.

Paul? Did I get it right?

Regards,
Boqun

Quoted 75 lines
kernel/rcu/rcutorture.c +2 -0
+               mask |= RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED;
+       WARN_ONCE(cur_ops->readlock_nesting && !(curstate & mask) &&
                  cur_ops->readlock_nesting() > 0, ROEC_ARGS);
 }
 
Quoted 70 lines

Thanx, Paul

Quoted 63 lines
Quoted 63 lines

Either way, thank you for your testing efforts!

Thanx, Paul

------------------------------------------------------------------------

commit bb638fe1a683316397d5517cb7d1797d70d21c86

Author: Paul E. McKenney <[email protected]>
Date:   Wed Feb 19 08:41:11 2025 -0800

rcutorture: Update rcutorture_one_extend_check() for lazy preemption

The rcutorture_one_extend_check() function's last check assumes that if cur_ops->readlock_nesting() returns greater than zero, either the RCUTORTURE_RDR_RCU_1 or the RCUTORTURE_RDR_RCU_2 bit must be set, that is, there must be at least one rcu_read_lock() in effect.

This works for preemptible RCU and for non-preemptible RCU running in a non-preemptible kernel. But it fails for non-preemptible RCU running in a preemptible kernel because then RCU's cur_ops->readlock_nesting() function, which is rcu_torture_readlock_nesting(), will return the PREEMPT_MASK mask bits from preempt_count(). The result will be greater than zero if preemption is disabled, including by the RCUTORTURE_RDR_PREEMPT and RCUTORTURE_RDR_SCHED bits.

This commit therefore adjusts this check to take into account the case fo non-preemptible RCU running in a preemptible kernel.

kernel/rcu/rcutorture.c +6 -2
index 895a27545ae1e..0f446ff04eda1 100644
@@ -1981,6 +1981,8 @@ static void rcu_torture_reader_do_mbchk(long myid, struct rcu_torture *rtp,
 #define ROEC_ARGS "%s %s: Current %#x  To add %#x  To remove %#x  preempt_count() %#x\n", __func__, s, curstate, new, old, preempt_count()
 static void rcutorture_one_extend_check(char *s, int curstate, int new, int old, bool insoftirq)
 {
+	int mask;
+
 	if (!IS_ENABLED(CONFIG_RCU_TORTURE_TEST_CHK_RDR_STATE))
 		return;
 
@@ -2010,8 +2012,10 @@ static void rcutorture_one_extend_check(char *s, int curstate, int new, int old,
 	WARN_ONCE(cur_ops->extendables &&
 		  !(curstate & (RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED)) &&
 		  (preempt_count() & PREEMPT_MASK), ROEC_ARGS);
-	WARN_ONCE(cur_ops->readlock_nesting &&
-		  !(curstate & (RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2)) &&
+	mask = RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2;
+	if (IS_ENABLED(CONFIG_PREEMPT_RCU))
+		mask |= RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED;
+	WARN_ONCE(cur_ops->readlock_nesting && !(curstate & mask) &&
 		  cur_ops->readlock_nesting() > 0, ROEC_ARGS);
 }
 
#7 lore raw
Quoted 69 lines · Boqun Feng

I finally find why I cannot reproduce this, I accidentally used next.2025.02.10a to build the kernel first, which has commit ("rcutorture: Move RCU_TORTURE_TEST_{CHK_RDR_STATE,LOG_CPU} to bool"), which changes Kconfig RCU_TORTURE_TEST_CHK_DRD_STATE into a bool and that disabled the test... (because config from you has it as =m).

Quoted 62 lines · Oliver Sang

hi, Paul,

On Fri, Feb 21, 2025 at 05:02:51PM -0800, Paul E. McKenney wrote:

[...]

Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

And rcutorture's WARN_ON() has a bug that is exposed by that change in Kconfig option. Does the patch shown below help?

the patch does not fix the WARNING in our tests. attached one dmesg FYI.

Quoted 8 lines

Just to make sure that I understand, this patch was applied against this commit, correct?

c9b55f9da0d2 ("rcu: limit PREEMPT_RCU configurations")

I am guessing this based on this dmesg line:

 [  109.553307][  T781] CPU: 1 UID: 0 PID: 781 Comm: rcu_torture_rea Tainted: G                T  6.14.0-rc1-00007-gc9b55f9da0d2 #1

above line is not from the dmesg I attached in last mail. it's from
https://download.01.org/0day-ci/archive/20250217/[email protected]/dmesg.xz
which is for our original report.

Quoted 2 lines

Is this really the case, or am I confused?

we applied your patch as:

89519085afdf2 fix for c9b55f9da0 from Paul c9b55f9da0d2c rcu: limit PREEMPT_RCU configurations f001b7165def8 osnoise: provide quiescent states

so in the dmesg I attached in last mail (I attached it again in this mail):

[    0.000000][    T0] Linux version 6.14.0-rc1-00008-g89519085afdf (kbuild@9871be4fdbcc) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT Fri Feb 21 00:34:02 CST 2025
...
[  117.463907][  T812] CPU: 1 UID: 0 PID: 812 Comm: rcu_torture_rea Tainted: G                T  6.14.0-rc1-00008-g89519085afdf #1

the change of this 89519085afdf2 is as [1]

I'm not sure if it's better to upload dmesg for fix patch to
https://download.01.org/0day-ci/archive/20250217/[email protected]
again, so I did not do that. sorry if this causes confusion.

not sure if this is the correct applyment? thanks

[1]

kernel/rcu/rcutorture.c +2 -0
index d26fb1d33ed9a..de85a88810cf6 100644
@@ -1873,6 +1873,8 @@ static void rcu_torture_reader_do_mbchk(long myid, struct rcu_torture *rtp,
 #define ROEC_ARGS "%s %s: Current %#x  To add %#x  To remove %#x  preempt_count() %#x\n", __func__, s, curstate, new, old, preempt_count()
 static void rcutorture_one_extend_check(char *s, int curstate, int new, int old, bool insoftirq)
 {
+       int mask;
+
        if (!IS_ENABLED(CONFIG_RCU_TORTURE_TEST_CHK_RDR_STATE))
                return;
 
Quoted 4 lines

kernel/rcu/rcutorture.c static void rcutorture_one_extend_check(char *s, int curstate, int new, int old, · line 1906

Quoted 4 lines
kernel/rcu/rcutorture.c +0 -0
@@ -1902,8 +1904,10 @@ static void rcutorture_one_extend_check(char *s, int curstate, int new, int old,
        WARN_ONCE(cur_ops->extendables &&
                  !(curstate & (RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED)) &&
                  (preempt_count() & PREEMPT_MASK), ROEC_ARGS);

And we need another fix for the WARN_ONCE() above because in non-preemptible RCU on a preemptible kernel, rcu_read_lock() is just preempt_disable(). Sending both really quick.

Regards,
Boqun

Quoted 32 lines

kernel/rcu/rcutorture.c static void rcutorture_one_extend_check(char *s, int curstate, int new, int old, · line 1908

Quoted 4 lines
kernel/rcu/rcutorture.c +2 -2
-       WARN_ONCE(cur_ops->readlock_nesting &&
-                 !(curstate & (RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2)) &&
+       mask = RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2;
+       if (IS_ENABLED(CONFIG_PREEMPT_RCU))

Now look into this, I think this should be:

if (!IS_ENABLED(CONFIG_PREEMPT_RCU))

because:

* For preemptible RCU, ->readlock_nesting() will return
rcu_preempt_depth()

* For non-preemptible RCU, ->readlock_nesting() will return
preempt count.

, which means if RCUTORTURE_RDR_PREEMPT or RCUTORTURE_RDR_SCHED is in the curstate for *non-preemption RCU*, ->readlock_nesting() will be >0. That is, the "mask" needs to consider _PREEMPT and _SCHED for *non-preemption RCU*, not preemptible RCU.

Paul? Did I get it right?

Regards,
Boqun

Quoted 5 lines
kernel/rcu/rcutorture.c +2 -0
+               mask |= RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED;
+       WARN_ONCE(cur_ops->readlock_nesting && !(curstate & mask) &&
                  cur_ops->readlock_nesting() > 0, ROEC_ARGS);
 }
 

[...]

#8 lore raw

PATCH v2 1/2 rcutorture: Update rcutorture_one_extend_check() for lazy preemption

From: "Paul E. McKenney" <[email protected]>

The rcutorture_one_extend_check() function's last check assumes that if cur_ops->readlock_nesting() returns greater than zero, either the RCUTORTURE_RDR_RCU_1 or the RCUTORTURE_RDR_RCU_2 bit must be set, that is, there must be at least one rcu_read_lock() in effect.

This works for preemptible RCU and for non-preemptible RCU running in a non-preemptible kernel. But it fails for non-preemptible RCU running in a preemptible kernel because then RCU's cur_ops->readlock_nesting() function, which is rcu_torture_readlock_nesting(), will return the PREEMPT_MASK mask bits from preempt_count(). The result will be greater than zero if preemption is disabled, including by the RCUTORTURE_RDR_PREEMPT and RCUTORTURE_RDR_SCHED bits.

This commit therefore adjusts this check to take into account the case fo non-preemptible RCU running in a preemptible kernel.

[boqun: Fix the if condition and add comment]

---
 kernel/rcu/rcutorture.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
kernel/rcu/rcutorture.c +12 -2
index d26fb1d33ed9..280bff706017 100644
@@ -1873,6 +1873,8 @@ static void rcu_torture_reader_do_mbchk(long myid, struct rcu_torture *rtp,
 #define ROEC_ARGS "%s %s: Current %#x  To add %#x  To remove %#x  preempt_count() %#x\n", __func__, s, curstate, new, old, preempt_count()
 static void rcutorture_one_extend_check(char *s, int curstate, int new, int old, bool insoftirq)
 {
+	int mask;
+
 	if (!IS_ENABLED(CONFIG_RCU_TORTURE_TEST_CHK_RDR_STATE))
 		return;
 
@@ -1902,8 +1904,16 @@ static void rcutorture_one_extend_check(char *s, int curstate, int new, int old,
 	WARN_ONCE(cur_ops->extendables &&
 		  !(curstate & (RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED)) &&
 		  (preempt_count() & PREEMPT_MASK), ROEC_ARGS);
-	WARN_ONCE(cur_ops->readlock_nesting &&
-		  !(curstate & (RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2)) &&
+
+	/*
+	 * non-preemptible RCU in a preemptible kernel uses "preempt_count() &
+	 * PREEMPT_MASK" as ->readlock_nesting().
+	 */
+	mask = RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2;
+	if (!IS_ENABLED(CONFIG_PREEMPT_RCU))
+		mask |= RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED;
+
+	WARN_ONCE(cur_ops->readlock_nesting && !(curstate & mask) &&
 		  cur_ops->readlock_nesting() > 0, ROEC_ARGS);
 }
 
Signature · 1 line
2.39.5 (Apple Git-154)
#9 lore raw

PATCH v2 2/2 rcutorture: Update ->extendables check for lazy preemption

The rcutorture_one_extend_check() function's second last check assumes that "preempt_count() & PREEMPT_MASK" is non-zero only if RCUTORTURE_RDR_PREEMPT or RCUTORTURE_RDR_SCHED bit is set.

This works for preemptible RCU and for non-preemptible RCU running in a non-preemptible kernel. But it fails for non-preemptible RCU running in a preemptible kernel because then rcu_read_lock() is just preempt_disable(), which increases preempt count.

This commit therefore adjusts this check to take into account the case fo non-preemptible RCU running in a preemptible kernel.

---
 kernel/rcu/rcutorture.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
kernel/rcu/rcutorture.c +10 -2
index 280bff706017..4cae119dece8 100644
@@ -1901,8 +1901,16 @@ static void rcutorture_one_extend_check(char *s, int curstate, int new, int old,
 	WARN_ONCE(cur_ops->extendables &&
 		  !(curstate & (RCUTORTURE_RDR_BH | RCUTORTURE_RDR_RBH)) &&
 		  (preempt_count() & SOFTIRQ_MASK), ROEC_ARGS);
-	WARN_ONCE(cur_ops->extendables &&
-		  !(curstate & (RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED)) &&
+
+	/*
+	 * non-preemptible RCU in a preemptible kernel uses preempt_disable()
+	 * as rcu_read_lock().
+	 */
+	mask = RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED;
+	if (!IS_ENABLED(CONFIG_PREEMPT_RCU))
+		mask |= RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2;
+
+	WARN_ONCE(cur_ops->extendables && !(curstate & mask) &&
 		  (preempt_count() & PREEMPT_MASK), ROEC_ARGS);
 
 	/*
Signature · 1 line
2.39.5 (Apple Git-154)
#10 lore raw

Re: [PATCH v2 2/2] rcutorture: Update ->extendables check for lazy preemption

[Cc Joel]

Quoted 44 lines · Boqun Feng

The rcutorture_one_extend_check() function's second last check assumes that "preempt_count() & PREEMPT_MASK" is non-zero only if RCUTORTURE_RDR_PREEMPT or RCUTORTURE_RDR_SCHED bit is set.

This works for preemptible RCU and for non-preemptible RCU running in a non-preemptible kernel. But it fails for non-preemptible RCU running in a preemptible kernel because then rcu_read_lock() is just preempt_disable(), which increases preempt count.

This commit therefore adjusts this check to take into account the case fo non-preemptible RCU running in a preemptible kernel.

---
 kernel/rcu/rcutorture.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
kernel/rcu/rcutorture.c +10 -2
index 280bff706017..4cae119dece8 100644
@@ -1901,8 +1901,16 @@ static void rcutorture_one_extend_check(char *s, int curstate, int new, int old,
 	WARN_ONCE(cur_ops->extendables &&
 		  !(curstate & (RCUTORTURE_RDR_BH | RCUTORTURE_RDR_RBH)) &&
 		  (preempt_count() & SOFTIRQ_MASK), ROEC_ARGS);
-	WARN_ONCE(cur_ops->extendables &&
-		  !(curstate & (RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED)) &&
+
+	/*
+	 * non-preemptible RCU in a preemptible kernel uses preempt_disable()
+	 * as rcu_read_lock().
+	 */
+	mask = RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED;
+	if (!IS_ENABLED(CONFIG_PREEMPT_RCU))
+		mask |= RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2;
+
+	WARN_ONCE(cur_ops->extendables && !(curstate & mask) &&
 		  (preempt_count() & PREEMPT_MASK), ROEC_ARGS);
 
 	/*
Signature · 1 line
2.39.5 (Apple Git-154)
maintainer Reviewed-by on v2 2/2
#11 lore raw

Re: [PATCH v2 2/2] rcutorture: Update ->extendables check for lazy preemption

In reply to Boqun Feng
Quoted 9 lines · Boqun Feng

The rcutorture_one_extend_check() function's second last check assumes that "preempt_count() & PREEMPT_MASK" is non-zero only if RCUTORTURE_RDR_PREEMPT or RCUTORTURE_RDR_SCHED bit is set.

This works for preemptible RCU and for non-preemptible RCU running in a non-preemptible kernel. But it fails for non-preemptible RCU running in a preemptible kernel because then rcu_read_lock() is just preempt_disable(), which increases preempt count.

Quoted 4 lines

This commit therefore adjusts this check to take into account the case fo non-preemptible RCU running in a preemptible kernel.

Quoted 30 lines
---
 kernel/rcu/rcutorture.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
kernel/rcu/rcutorture.c +10 -2
index 280bff706017..4cae119dece8 100644
@@ -1901,8 +1901,16 @@ static void rcutorture_one_extend_check(char *s, int curstate, int new, int old,
 	WARN_ONCE(cur_ops->extendables &&
 		  !(curstate & (RCUTORTURE_RDR_BH | RCUTORTURE_RDR_RBH)) &&
 		  (preempt_count() & SOFTIRQ_MASK), ROEC_ARGS);
-	WARN_ONCE(cur_ops->extendables &&
-		  !(curstate & (RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED)) &&
+
+	/*
+	 * non-preemptible RCU in a preemptible kernel uses preempt_disable()
+	 * as rcu_read_lock().
+	 */
+	mask = RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED;
+	if (!IS_ENABLED(CONFIG_PREEMPT_RCU))
+		mask |= RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2;
+
+	WARN_ONCE(cur_ops->extendables && !(curstate & mask) &&
 		  (preempt_count() & PREEMPT_MASK), ROEC_ARGS);
 
 	/*
Signature · 1 line
2.39.5 (Apple Git-154)
maintainer
#12 lore raw

Re: [PATCH v2 1/2] rcutorture: Update rcutorture_one_extend_check() for lazy preemption

In reply to Boqun Feng
Quoted 48 lines · Boqun Feng

From: "Paul E. McKenney" <[email protected]>

The rcutorture_one_extend_check() function's last check assumes that if cur_ops->readlock_nesting() returns greater than zero, either the RCUTORTURE_RDR_RCU_1 or the RCUTORTURE_RDR_RCU_2 bit must be set, that is, there must be at least one rcu_read_lock() in effect.

This works for preemptible RCU and for non-preemptible RCU running in a non-preemptible kernel. But it fails for non-preemptible RCU running in a preemptible kernel because then RCU's cur_ops->readlock_nesting() function, which is rcu_torture_readlock_nesting(), will return the PREEMPT_MASK mask bits from preempt_count(). The result will be greater than zero if preemption is disabled, including by the RCUTORTURE_RDR_PREEMPT and RCUTORTURE_RDR_SCHED bits.

This commit therefore adjusts this check to take into account the case fo non-preemptible RCU running in a preemptible kernel.

[boqun: Fix the if condition and add comment]

---
 kernel/rcu/rcutorture.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
kernel/rcu/rcutorture.c +2 -0
index d26fb1d33ed9..280bff706017 100644
@@ -1873,6 +1873,8 @@ static void rcu_torture_reader_do_mbchk(long myid, struct rcu_torture *rtp,
 #define ROEC_ARGS "%s %s: Current %#x  To add %#x  To remove %#x  preempt_count() %#x\n", __func__, s, curstate, new, old, preempt_count()
 static void rcutorture_one_extend_check(char *s, int curstate, int new, int old, bool insoftirq)
 {
+	int mask;
+
 	if (!IS_ENABLED(CONFIG_RCU_TORTURE_TEST_CHK_RDR_STATE))
 		return;
 
@@ -1902,8 +1904,16 @@ static void rcutorture_one_extend_check(char *s, int curstate, int new, int old,
 	WARN_ONCE(cur_ops->extendables &&
 		  !(curstate & (RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED)) &&

kernel/rcu/rcutorture.c static void rcutorture_one_extend_check(char *s, int curstate, int new, int old, · line 1913

Quoted 10 lines
kernel/rcu/rcutorture.c +7 -2
 		  (preempt_count() & PREEMPT_MASK), ROEC_ARGS);
-	WARN_ONCE(cur_ops->readlock_nesting &&
-		  !(curstate & (RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2)) &&
+
+	/*
+	 * non-preemptible RCU in a preemptible kernel uses "preempt_count() &
+	 * PREEMPT_MASK" as ->readlock_nesting().
+	 */
+	mask = RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2;
+	if (!IS_ENABLED(CONFIG_PREEMPT_RCU))

Good catch, thank you, and it looks good to me!

Oliver, you are right, I was looking at the wrong console output. One of those days, I guess... :-/

Thanx, Paul

Quoted 9 lines
kernel/rcu/rcutorture.c +3 -0
+		mask |= RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED;
+
+	WARN_ONCE(cur_ops->readlock_nesting && !(curstate & mask) &&
 		  cur_ops->readlock_nesting() > 0, ROEC_ARGS);
 }
 
Signature · 1 line
2.39.5 (Apple Git-154)
author Tested-by
#13 lore raw

Re: [PATCH v2 1/2] rcutorture: Update rcutorture_one_extend_check() for lazy preemption

hi, Paul, hi, Boqun Feng,

Quoted 62 lines · Paul E. McKenney
Quoted 48 lines · Boqun Feng

From: "Paul E. McKenney" <[email protected]>

The rcutorture_one_extend_check() function's last check assumes that if cur_ops->readlock_nesting() returns greater than zero, either the RCUTORTURE_RDR_RCU_1 or the RCUTORTURE_RDR_RCU_2 bit must be set, that is, there must be at least one rcu_read_lock() in effect.

This works for preemptible RCU and for non-preemptible RCU running in a non-preemptible kernel. But it fails for non-preemptible RCU running in a preemptible kernel because then RCU's cur_ops->readlock_nesting() function, which is rcu_torture_readlock_nesting(), will return the PREEMPT_MASK mask bits from preempt_count(). The result will be greater than zero if preemption is disabled, including by the RCUTORTURE_RDR_PREEMPT and RCUTORTURE_RDR_SCHED bits.

This commit therefore adjusts this check to take into account the case fo non-preemptible RCU running in a preemptible kernel.

[boqun: Fix the if condition and add comment]

---
 kernel/rcu/rcutorture.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
kernel/rcu/rcutorture.c +2 -0
index d26fb1d33ed9..280bff706017 100644
@@ -1873,6 +1873,8 @@ static void rcu_torture_reader_do_mbchk(long myid, struct rcu_torture *rtp,
 #define ROEC_ARGS "%s %s: Current %#x  To add %#x  To remove %#x  preempt_count() %#x\n", __func__, s, curstate, new, old, preempt_count()
 static void rcutorture_one_extend_check(char *s, int curstate, int new, int old, bool insoftirq)
 {
+	int mask;
+
 	if (!IS_ENABLED(CONFIG_RCU_TORTURE_TEST_CHK_RDR_STATE))
 		return;
 
@@ -1902,8 +1904,16 @@ static void rcutorture_one_extend_check(char *s, int curstate, int new, int old,
 	WARN_ONCE(cur_ops->extendables &&
 		  !(curstate & (RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED)) &&

kernel/rcu/rcutorture.c static void rcutorture_one_extend_check(char *s, int curstate, int new, int old, · line 1913

Quoted 10 lines
kernel/rcu/rcutorture.c +7 -2
 		  (preempt_count() & PREEMPT_MASK), ROEC_ARGS);
-	WARN_ONCE(cur_ops->readlock_nesting &&
-		  !(curstate & (RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2)) &&
+
+	/*
+	 * non-preemptible RCU in a preemptible kernel uses "preempt_count() &
+	 * PREEMPT_MASK" as ->readlock_nesting().
+	 */
+	mask = RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2;
+	if (!IS_ENABLED(CONFIG_PREEMPT_RCU))

Good catch, thank you, and it looks good to me!

Quoted 2 lines

Oliver, you are right, I was looking at the wrong console output. One of those days, I guess... :-/

we tested this new patch-set, and confirmed the WARN we reported is fixed by whole patch-set. thanks

just want to confirm one thing, we applied the patch-set as below:

* b9aa59295f037 rcutorture: Update ->extendables check for lazy preemption
* 5ffd825e807bd rcutorture: Update rcutorture_one_extend_check() for lazy preemption
* c9b55f9da0d2c rcu: limit PREEMPT_RCU configurations

we also made the test upon 5ffd825e807bd, which still shows the similar WARN. is this expected?

Quoted 12 lines

Thanx, Paul

Quoted 9 lines
kernel/rcu/rcutorture.c +3 -0
+		mask |= RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED;
+
+	WARN_ONCE(cur_ops->readlock_nesting && !(curstate & mask) &&
 		  cur_ops->readlock_nesting() > 0, ROEC_ARGS);
 }
 
Signature · 1 line
2.39.5 (Apple Git-154)
#14 lore raw

Re: [PATCH v2 1/2] rcutorture: Update rcutorture_one_extend_check() for lazy preemption

Quoted 65 lines · Oliver Sang

hi, Paul, hi, Boqun Feng,

Quoted 62 lines · Paul E. McKenney
Quoted 48 lines · Boqun Feng

From: "Paul E. McKenney" <[email protected]>

The rcutorture_one_extend_check() function's last check assumes that if cur_ops->readlock_nesting() returns greater than zero, either the RCUTORTURE_RDR_RCU_1 or the RCUTORTURE_RDR_RCU_2 bit must be set, that is, there must be at least one rcu_read_lock() in effect.

This works for preemptible RCU and for non-preemptible RCU running in a non-preemptible kernel. But it fails for non-preemptible RCU running in a preemptible kernel because then RCU's cur_ops->readlock_nesting() function, which is rcu_torture_readlock_nesting(), will return the PREEMPT_MASK mask bits from preempt_count(). The result will be greater than zero if preemption is disabled, including by the RCUTORTURE_RDR_PREEMPT and RCUTORTURE_RDR_SCHED bits.

This commit therefore adjusts this check to take into account the case fo non-preemptible RCU running in a preemptible kernel.

[boqun: Fix the if condition and add comment]

---
 kernel/rcu/rcutorture.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
kernel/rcu/rcutorture.c +2 -0
index d26fb1d33ed9..280bff706017 100644
@@ -1873,6 +1873,8 @@ static void rcu_torture_reader_do_mbchk(long myid, struct rcu_torture *rtp,
 #define ROEC_ARGS "%s %s: Current %#x  To add %#x  To remove %#x  preempt_count() %#x\n", __func__, s, curstate, new, old, preempt_count()
 static void rcutorture_one_extend_check(char *s, int curstate, int new, int old, bool insoftirq)
 {
+	int mask;
+
 	if (!IS_ENABLED(CONFIG_RCU_TORTURE_TEST_CHK_RDR_STATE))
 		return;
 
@@ -1902,8 +1904,16 @@ static void rcutorture_one_extend_check(char *s, int curstate, int new, int old,
 	WARN_ONCE(cur_ops->extendables &&
 		  !(curstate & (RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED)) &&

kernel/rcu/rcutorture.c static void rcutorture_one_extend_check(char *s, int curstate, int new, int old, · line 1913

Quoted 10 lines
kernel/rcu/rcutorture.c +7 -2
 		  (preempt_count() & PREEMPT_MASK), ROEC_ARGS);
-	WARN_ONCE(cur_ops->readlock_nesting &&
-		  !(curstate & (RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2)) &&
+
+	/*
+	 * non-preemptible RCU in a preemptible kernel uses "preempt_count() &
+	 * PREEMPT_MASK" as ->readlock_nesting().
+	 */
+	mask = RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2;
+	if (!IS_ENABLED(CONFIG_PREEMPT_RCU))

Good catch, thank you, and it looks good to me!

Quoted 9 lines
Quoted 2 lines

Oliver, you are right, I was looking at the wrong console output. One of those days, I guess... :-/

we tested this new patch-set, and confirmed the WARN we reported is fixed by whole patch-set. thanks

Thanks!

Quoted 10 lines

just want to confirm one thing, we applied the patch-set as below:

* b9aa59295f037 rcutorture: Update ->extendables check for lazy preemption
* 5ffd825e807bd rcutorture: Update rcutorture_one_extend_check() for lazy preemption
* c9b55f9da0d2c rcu: limit PREEMPT_RCU configurations

we also made the test upon 5ffd825e807bd, which still shows the similar WARN. is this expected?

Yes, that's expected, and that's why commit b9aa59295f037 is needed, thank you for the double confirmation.

Regards,
Boqun

Quoted 12 lines
Quoted 12 lines

Thanx, Paul

Quoted 9 lines
kernel/rcu/rcutorture.c +3 -0
+		mask |= RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED;
+
+	WARN_ONCE(cur_ops->readlock_nesting && !(curstate & mask) &&
 		  cur_ops->readlock_nesting() > 0, ROEC_ARGS);
 }
 
Signature · 1 line
2.39.5 (Apple Git-154)
#15 lore raw

Re: [PATCH v2 1/2] rcutorture: Update rcutorture_one_extend_check() for lazy preemption

hi, Boqun,

On Mon, Feb 24, 2025 at 07:37:25PM -0800, Boqun Feng wrote:

[...]

Quoted 10 lines
Quoted 8 lines

* b9aa59295f037 rcutorture: Update ->extendables check for lazy preemption
* 5ffd825e807bd rcutorture: Update rcutorture_one_extend_check() for lazy preemption
* c9b55f9da0d2c rcu: limit PREEMPT_RCU configurations

we also made the test upon 5ffd825e807bd, which still shows the similar WARN. is this expected?

Yes, that's expected, and that's why commit b9aa59295f037 is needed,

thanks a lot for information!

Quoted 1 line

thank you for the double confirmation.

you are welcome. always our great pleasure :)

Quoted 17 lines

Regards,
Boqun

Quoted 12 lines
Quoted 12 lines

Thanx, Paul

Quoted 9 lines
kernel/rcu/rcutorture.c +3 -0
+		mask |= RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED;
+
+	WARN_ONCE(cur_ops->readlock_nesting && !(curstate & mask) &&
 		  cur_ops->readlock_nesting() > 0, ROEC_ARGS);
 }
Signature · 2 lines
-- 
2.39.5 (Apple Git-154)