Zqiang
668c0406d8
rcutorture: Fix invalid context warning when enable srcu barrier testing
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>
2024-04-16 11:16:36 +02:00
..
2024-03-31 11:23:51 -07:00
2024-03-12 17:44:08 -07:00
2024-03-12 17:44:08 -07:00
2024-01-17 17:19:06 +00:00
2024-03-24 10:45:31 -07:00
2024-03-12 13:23:32 +01:00
2024-03-14 17:43:30 -07:00
2024-01-19 12:58:17 +01:00
2023-10-18 14:43:22 -07:00
2024-03-25 23:45:21 +01:00
2023-10-18 14:34:17 -07:00
2023-09-20 11:24:18 +02:00
2024-03-01 13:02:05 +01:00
2024-03-25 10:48:23 -07:00
2024-03-21 17:16:46 -07:00
2024-03-26 09:25:57 -07:00
2024-04-16 11:16:36 +02:00
2024-03-22 10:41:13 -07:00
2024-03-27 09:03:22 -07:00
2024-03-27 10:01:24 -07:00
2023-09-11 15:05:50 +02:00
2024-02-09 11:13:59 -10:00
2022-08-22 18:50:06 -04:00
2023-11-02 20:53:31 -10:00
2023-11-14 17:34:27 -05:00
2024-01-25 10:12:22 -05:00
2023-07-21 12:17:25 -04:00
2024-01-25 09:59:27 -05:00
2023-10-13 18:34:46 +02:00
2024-02-05 13:22:34 -10:00
2024-02-22 15:38:51 -08:00
2023-08-08 16:48:47 -04:00
2022-09-26 10:13:13 -07:00
2023-03-14 19:32:38 -07:00
2024-02-14 07:53:50 -08:00
2023-01-13 11:48:15 +01:00
2024-03-11 15:45:55 -07:00
2024-02-23 17:48:22 -08:00
2024-03-26 11:14:12 -07:00
2024-02-23 17:33:31 -05:00
2023-04-18 16:39:34 -07:00
2024-02-23 17:48:22 -08:00
2024-03-11 10:21:06 -07:00
2023-09-21 12:03:50 -06:00
2023-02-08 13:36:22 +01:00
2024-03-11 12:02:50 -07:00
2023-12-23 15:52:13 +01:00
2023-05-28 16:20:21 +09:00
2023-09-29 11:28:39 -07:00
2024-03-13 21:22:04 -04:00
2023-08-21 13:37:28 -07:00
2023-03-24 11:01:29 +01:00
2022-12-01 15:53:05 -08:00
2022-11-12 18:47:36 -08:00
2024-02-23 17:48:19 -08:00
2022-11-15 00:42:02 -08:00
2023-08-25 15:00:36 -07:00
2023-10-19 11:02:48 +02:00
2024-02-23 17:48:22 -08:00
2023-06-09 17:44:17 -07:00
2024-03-14 18:03:09 -07:00
2024-02-23 17:48:23 -08:00
2024-02-23 17:48:22 -08:00
2024-02-23 17:48:22 -08:00
2023-03-24 20:10:59 -07:00
2024-02-08 23:29:29 +09:00
2023-06-08 12:27:20 -07:00
2024-03-21 13:34:15 -07:00
2023-11-02 20:53:31 -10:00
2022-09-11 21:55:12 -07:00
2024-02-23 17:48:22 -08:00
2023-04-08 13:45:38 -07:00
2024-03-01 12:23:37 +01:00
2023-12-20 19:26:30 -05:00
2024-03-06 13:04:17 -08:00
2024-03-14 18:03:09 -07:00
2023-12-01 09:51:44 -08:00
2023-12-20 19:26:31 -05:00
2023-08-21 13:37:59 -07:00
2024-03-13 12:53:53 -07:00
2022-09-11 21:55:12 -07:00
2024-02-22 15:38:52 -08:00
2024-01-09 16:20:17 -08:00
2023-12-29 12:22:27 -08:00
2024-01-09 11:46:20 -08:00
2022-12-27 12:52:12 +01:00
2023-07-14 15:02:57 -07:00
2022-11-09 18:06:35 +00:00
2023-12-12 14:24:14 +01:00
2024-03-14 18:03:09 -07:00
2023-10-30 17:56:53 -10:00
2023-10-04 10:41:57 -07:00
2024-02-29 11:51:24 -10:00
2023-04-20 11:36:35 +02:00
2023-12-29 12:22:29 -08:00
2022-10-17 16:41:16 +02:00
2024-01-09 12:57:46 -08:00
2024-03-26 11:07:22 -07:00
2022-09-08 16:56:45 -07:00
2024-03-18 10:33:06 -04:00
2023-09-19 13:21:32 -07:00
2023-10-04 10:41:57 -07:00
2023-09-24 17:24:01 +02:00
2023-02-18 14:34:36 -05:00
2023-08-15 15:26:17 -07:00
2023-06-29 15:19:43 -07:00
2023-09-13 14:59:24 +02:00
2024-02-22 15:38:52 -08:00
2023-10-11 08:46:01 -07:00
2023-04-13 11:49:35 -07:00
2023-06-08 15:43:09 -04:00
2024-03-04 17:01:27 -08:00
2023-12-21 13:17:54 +01:00
2023-06-19 16:25:28 -07:00
2023-06-09 17:44:21 -07:00
2024-03-12 13:09:23 -07:00
2023-08-07 15:57:22 -10:00
2024-03-21 13:34:15 -07:00