Zqiang
103b56af90
rcutorture: Fix invalid context warning when enable srcu barrier testing
...
[ Upstream commit 668c0406d8
]
When the torture_type is set srcu or srcud and cb_barrier is
non-zero, running the rcutorture test will trigger the
following warning:
[ 163.910989][ C1] BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48
[ 163.910994][ C1] in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 0, name: swapper/1
[ 163.910999][ C1] preempt_count: 10001, expected: 0
[ 163.911002][ C1] RCU nest depth: 0, expected: 0
[ 163.911005][ C1] INFO: lockdep is turned off.
[ 163.911007][ C1] irq event stamp: 30964
[ 163.911010][ C1] hardirqs last enabled at (30963): [<ffffffffabc7df52>] do_idle+0x362/0x500
[ 163.911018][ C1] hardirqs last disabled at (30964): [<ffffffffae616eff>] sysvec_call_function_single+0xf/0xd0
[ 163.911025][ C1] softirqs last enabled at (0): [<ffffffffabb6475f>] copy_process+0x16ff/0x6580
[ 163.911033][ C1] softirqs last disabled at (0): [<0000000000000000>] 0x0
[ 163.911038][ C1] Preemption disabled at:
[ 163.911039][ C1] [<ffffffffacf1964b>] stack_depot_save_flags+0x24b/0x6c0
[ 163.911063][ C1] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G W 6.8.0-rc4-rt4-yocto-preempt-rt+ #3 1e39aa9a737dd024a3275c4f835a872f673a7d3a
[ 163.911071][ C1] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.2-0-gea1b7a073390-prebuilt.qemu.org 04/01/2014
[ 163.911075][ C1] Call Trace:
[ 163.911078][ C1] <IRQ>
[ 163.911080][ C1] dump_stack_lvl+0x88/0xd0
[ 163.911089][ C1] dump_stack+0x10/0x20
[ 163.911095][ C1] __might_resched+0x36f/0x530
[ 163.911105][ C1] rt_spin_lock+0x82/0x1c0
[ 163.911112][ C1] spin_lock_irqsave_ssp_contention+0xb8/0x100
[ 163.911121][ C1] srcu_gp_start_if_needed+0x782/0xf00
[ 163.911128][ C1] ? _raw_spin_unlock_irqrestore+0x46/0x70
[ 163.911136][ C1] ? debug_object_active_state+0x336/0x470
[ 163.911148][ C1] ? __pfx_srcu_gp_start_if_needed+0x10/0x10
[ 163.911156][ C1] ? __pfx_lock_release+0x10/0x10
[ 163.911165][ C1] ? __pfx_rcu_torture_barrier_cbf+0x10/0x10
[ 163.911188][ C1] __call_srcu+0x9f/0xe0
[ 163.911196][ C1] call_srcu+0x13/0x20
[ 163.911201][ C1] srcu_torture_call+0x1b/0x30
[ 163.911224][ C1] rcu_torture_barrier1cb+0x4a/0x60
[ 163.911247][ C1] __flush_smp_call_function_queue+0x267/0xca0
[ 163.911256][ C1] ? __pfx_rcu_torture_barrier1cb+0x10/0x10
[ 163.911281][ C1] generic_smp_call_function_single_interrupt+0x13/0x20
[ 163.911288][ C1] __sysvec_call_function_single+0x7d/0x280
[ 163.911295][ C1] sysvec_call_function_single+0x93/0xd0
[ 163.911302][ C1] </IRQ>
[ 163.911304][ C1] <TASK>
[ 163.911308][ C1] asm_sysvec_call_function_single+0x1b/0x20
[ 163.911313][ C1] RIP: 0010:default_idle+0x17/0x20
[ 163.911326][ C1] RSP: 0018:ffff888001997dc8 EFLAGS: 00000246
[ 163.911333][ C1] RAX: 0000000000000000 RBX: dffffc0000000000 RCX: ffffffffae618b51
[ 163.911337][ C1] RDX: 0000000000000000 RSI: ffffffffaea80920 RDI: ffffffffaec2de80
[ 163.911342][ C1] RBP: ffff888001997dc8 R08: 0000000000000001 R09: ffffed100d740cad
[ 163.911346][ C1] R10: ffffed100d740cac R11: ffff88806ba06563 R12: 0000000000000001
[ 163.911350][ C1] R13: ffffffffafe460c0 R14: ffffffffafe460c0 R15: 0000000000000000
[ 163.911358][ C1] ? ct_kernel_exit.constprop.3+0x121/0x160
[ 163.911369][ C1] ? lockdep_hardirqs_on+0xc4/0x150
[ 163.911376][ C1] arch_cpu_idle+0x9/0x10
[ 163.911383][ C1] default_idle_call+0x7a/0xb0
[ 163.911390][ C1] do_idle+0x362/0x500
[ 163.911398][ C1] ? __pfx_do_idle+0x10/0x10
[ 163.911404][ C1] ? complete_with_flags+0x8b/0xb0
[ 163.911416][ C1] cpu_startup_entry+0x58/0x70
[ 163.911423][ C1] start_secondary+0x221/0x280
[ 163.911430][ C1] ? __pfx_start_secondary+0x10/0x10
[ 163.911440][ C1] secondary_startup_64_no_verify+0x17f/0x18b
[ 163.911455][ C1] </TASK>
This commit therefore use smp_call_on_cpu() instead of
smp_call_function_single(), make rcu_torture_barrier1cb() invoked
happens on task-context.
Signed-off-by: Zqiang <qiang.zhang1211@gmail.com >
Signed-off-by: Paul E. McKenney <paulmck@kernel.org >
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2024-07-05 09:14:25 +02:00
..
2024-07-05 09:14:12 +02:00
2024-06-16 13:39:34 +02:00
2021-05-07 00:26:34 -07:00
2024-06-16 13:39:59 +02:00
2024-07-05 09:14:13 +02:00
2024-04-10 16:18:46 +02:00
2024-04-10 16:19:29 +02:00
2023-11-20 11:08:13 +01:00
2022-12-31 13:14:47 +01:00
2024-06-16 13:39:52 +02:00
2023-07-23 13:47:12 +02:00
2023-11-20 11:08:25 +01:00
2024-04-10 16:19:37 +02:00
2024-04-10 16:18:36 +02:00
2024-04-10 16:18:47 +02:00
2024-07-05 09:14:25 +02:00
2024-06-16 13:39:34 +02:00
2024-07-05 09:14:22 +02:00
2024-07-05 09:14:12 +02:00
2021-05-02 00:43:35 +09:00
2022-12-31 13:14:40 +01:00
2024-02-23 08:54:25 +01:00
2024-04-10 16:19:02 +02:00
2024-04-10 16:19:02 +02:00
2024-04-10 16:19:02 +02:00
2024-02-23 08:54:37 +01:00
2022-04-08 14:23:06 +02:00
2023-09-19 12:22:39 +02:00
2024-05-02 16:24:50 +02:00
2022-06-22 14:22:04 +02:00
2023-04-05 11:24:53 +02:00
2021-08-16 18:55:32 +02:00
2024-05-02 16:24:48 +02:00
2021-12-29 12:28:49 +01:00
2023-12-20 15:17:37 +01:00
2021-05-12 11:43:25 +02:00
2023-02-01 08:27:22 +01:00
2023-03-11 13:57:38 +01:00
2023-09-23 11:09:55 +02:00
2021-06-18 11:43:08 +02:00
2021-05-27 04:01:50 +09:00
2021-07-02 12:08:10 -07:00
2021-06-10 10:00:08 +02:00
2021-07-05 10:46:20 +02:00
2023-12-13 18:36:45 +01:00
2021-08-17 17:50:51 +02:00
2021-06-28 22:43:05 +02:00
2023-07-23 13:46:52 +02:00
2023-06-21 15:59:14 +02:00
2023-04-20 12:13:57 +02:00
2023-11-28 16:56:16 +00:00
2023-05-11 23:00:17 +09:00
2021-05-07 00:26:33 -07:00
2024-07-05 09:14:12 +02:00
2023-04-20 12:13:57 +02:00
2024-04-10 16:18:55 +02:00
2022-12-31 13:14:04 +01:00
2024-04-10 16:19:01 +02:00
2021-08-16 18:55:32 +02:00
2021-09-03 09:58:12 -07:00
2024-07-05 09:14:24 +02:00
2024-04-13 13:01:43 +02:00
2021-08-16 14:42:22 +02:00
2024-07-05 09:14:24 +02:00
2021-08-10 12:53:07 +02:00
2022-08-17 14:24:04 +02:00
2022-06-09 10:22:29 +02:00
2023-11-28 16:56:31 +00:00
2023-05-11 23:00:18 +09:00
2023-03-10 09:40:08 +01:00
2022-04-08 14:23:10 +02:00
2023-09-23 11:09:55 +02:00
2021-11-18 19:16:29 +01:00
2022-02-16 12:56:38 +01:00
2022-07-21 21:24:42 +02:00
2022-08-17 14:24:24 +02:00
2021-08-10 14:57:42 +02:00
2024-06-16 13:39:15 +02:00
2022-02-23 12:03:07 +01:00
2022-04-13 20:59:28 +02:00
2022-04-13 20:59:28 +02:00
2022-04-13 20:59:28 +02:00
2022-08-31 17:16:33 +02:00
2024-03-15 10:48:22 -04:00
2021-06-23 16:41:24 -06:00
2024-03-01 13:21:43 +01:00
2021-04-30 11:20:42 -07:00
2023-08-30 16:18:19 +02:00
2021-08-16 11:39:51 -04:00
2022-01-27 11:05:35 +01:00
2022-02-23 12:03:20 +01:00
2021-05-07 00:26:34 -07:00
2021-05-09 13:07:03 -07:00
2022-03-08 19:12:42 +01:00
2021-09-08 11:50:27 -07:00
2021-07-03 11:41:14 -07:00
2023-11-28 16:56:16 +00:00
2023-07-23 13:46:52 +02:00
2023-11-28 16:56:28 +00:00
2021-08-17 07:49:10 -10:00
2023-12-08 08:48:03 +01:00