Shigeru Yoshida
5fc8cbe4cf
rcu-tasks: Avoid pr_info() with spin lock in cblist_init_generic()
pr_info() is called with rtp->cbs_gbl_lock spin lock locked. Because
pr_info() calls printk() that might sleep, this will result in BUG
like below:
[ 0.206455] cblist_init_generic: Setting adjustable number of callback queues.
[ 0.206463]
[ 0.206464] =============================
[ 0.206464] [ BUG: Invalid wait context ]
[ 0.206465] 5.19.0-00428-g9de1f9c8ca51 #5 Not tainted
[ 0.206466] -----------------------------
[ 0.206466] swapper/0/1 is trying to lock:
[ 0.206467] ffffffffa0167a58 (&port_lock_key){....}-{3:3}, at: serial8250_console_write+0x327/0x4a0
[ 0.206473] other info that might help us debug this:
[ 0.206473] context-{5:5}
[ 0.206474] 3 locks held by swapper/0/1:
[ 0.206474] #0: ffffffff9eb597e0 (rcu_tasks.cbs_gbl_lock){....}-{2:2}, at: cblist_init_generic.constprop.0+0x14/0x1f0
[ 0.206478] #1: ffffffff9eb579c0 (console_lock){+.+.}-{0:0}, at: _printk+0x63/0x7e
[ 0.206482] #2: ffffffff9ea77780 (console_owner){....}-{0:0}, at: console_emit_next_record.constprop.0+0x111/0x330
[ 0.206485] stack backtrace:
[ 0.206486] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.19.0-00428-g9de1f9c8ca51 #5
[ 0.206488] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-1.fc36 04/01/2014
[ 0.206489] Call Trace:
[ 0.206490] <TASK>
[ 0.206491] dump_stack_lvl+0x6a/0x9f
[ 0.206493] __lock_acquire.cold+0x2d7/0x2fe
[ 0.206496] ? stack_trace_save+0x46/0x70
[ 0.206497] lock_acquire+0xd1/0x2f0
[ 0.206499] ? serial8250_console_write+0x327/0x4a0
[ 0.206500] ? __lock_acquire+0x5c7/0x2720
[ 0.206502] _raw_spin_lock_irqsave+0x3d/0x90
[ 0.206504] ? serial8250_console_write+0x327/0x4a0
[ 0.206506] serial8250_console_write+0x327/0x4a0
[ 0.206508] console_emit_next_record.constprop.0+0x180/0x330
[ 0.206511] console_unlock+0xf7/0x1f0
[ 0.206512] vprintk_emit+0xf7/0x330
[ 0.206514] _printk+0x63/0x7e
[ 0.206516] cblist_init_generic.constprop.0.cold+0x24/0x32
[ 0.206518] rcu_init_tasks_generic+0x5/0xd9
[ 0.206522] kernel_init_freeable+0x15b/0x2a2
[ 0.206523] ? rest_init+0x160/0x160
[ 0.206526] kernel_init+0x11/0x120
[ 0.206527] ret_from_fork+0x1f/0x30
[ 0.206530] </TASK>
[ 0.207018] cblist_init_generic: Setting shift to 1 and lim to 1.
This patch moves pr_info() so that it is called without
rtp->cbs_gbl_lock locked.
Signed-off-by: Shigeru Yoshida <syoshida@redhat.com>
Tested-by: "Zhang, Qiang1" <qiang1.zhang@intel.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2023-05-09 17:27:42 -07:00
..
2023-04-29 10:05:22 -07:00
2023-04-29 10:05:22 -07:00
2023-04-27 12:07:50 -07:00
2022-12-02 11:25:00 +01:00
2023-04-29 10:29:57 -07:00
2023-04-16 14:23:07 +02:00
2023-04-28 14:41:53 -07:00
2023-01-01 11:15:05 -08:00
2022-12-21 14:31:52 -08:00
2023-04-15 10:17:16 +02:00
2023-04-27 19:42:02 -07:00
2023-04-28 14:53:30 -07:00
2023-05-05 12:56:55 -07:00
2023-05-02 20:33:36 -07:00
2023-05-03 12:01:05 -07:00
2023-04-27 19:42:02 -07:00
2023-05-09 17:27:42 -07:00
2023-04-28 15:03:43 -07:00
2023-04-29 10:24:30 -07:00
2023-05-05 13:11:02 -07:00
2022-11-30 16:13:18 -08:00
2022-08-22 18:50:06 -04:00
2022-04-25 14:37:28 +02:00
2022-09-01 17:39:30 -04:00
2022-08-29 19:47:03 -04:00
2022-09-07 11:30:15 -04:00
2023-03-01 10:01:22 -08:00
2022-09-26 19:46:09 -07:00
2023-03-01 10:01:22 -08:00
2022-09-26 10:13:13 -07:00
2023-03-14 19:32:38 -07:00
2023-01-13 11:48:18 +01:00
2023-01-13 11:48:15 +01:00
2023-04-27 19:42:02 -07:00
2023-04-05 19:42:46 -07:00
2022-11-01 10:04:52 -07:00
2023-04-18 16:39:34 -07:00
2023-04-28 15:57:53 -07:00
2022-07-05 13:32:59 -07:00
2023-02-08 13:36:22 +01:00
2023-04-30 13:00:38 -07:00
2022-09-07 21:53:50 +02:00
2023-01-22 23:43:34 +09:00
2022-07-15 18:21:49 +00:00
2023-04-08 13:45:37 -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
2023-03-19 13:27:19 -07:00
2022-11-15 00:42:02 -08:00
2023-03-19 13:27:19 -07:00
2023-02-09 16:51:39 -08:00
2023-02-23 17:55:40 -08:00
2023-04-08 13:45:38 -07:00
2022-09-11 21:55:06 -07:00
2023-02-02 22:50:05 -08:00
2023-03-24 20:10:59 -07:00
2023-02-21 08:49:16 +09:00
2023-03-24 17:09:14 +01:00
2023-04-27 19:42:02 -07:00
2022-09-11 21:55:12 -07:00
2023-04-27 16:36:55 -07:00
2023-04-08 13:45:38 -07:00
2023-04-20 22:55:35 -04:00
2023-03-14 17:06:44 +08:00
2023-04-14 17:31:26 +02:00
2023-03-09 12:55:15 -08:00
2023-05-02 19:23:29 -07:00
2023-05-02 19:23:29 -07:00
2023-04-03 11:16:56 +02:00
2022-09-11 21:55:12 -07:00
2023-04-16 14:23:07 +02:00
2022-10-04 15:59:36 +02:00
2023-05-02 17:23:27 -07:00
2023-02-17 14:58:01 -08:00
2022-12-27 12:52:12 +01:00
2022-11-09 18:06:35 +00:00
2023-04-13 11:49:20 -07:00
2023-04-16 09:00:18 +02:00
2023-03-24 11:01:30 +01:00
2022-09-11 21:55:10 -07:00
2023-04-15 10:17:16 +02:00
2023-04-20 11:36:35 +02:00
2022-10-17 16:41:16 +02:00
2022-05-24 11:11:13 -07:00
2022-08-20 15:17:45 -07:00
2023-05-02 17:21:49 -07:00
2022-09-08 16:56:45 -07:00
2023-04-13 11:49:35 -07:00
2022-09-11 21:55:10 -07:00
2022-08-29 12:47:15 +01:00
2023-01-05 12:10:35 -08:00
2023-02-18 14:34:36 -05:00
2022-04-29 14:38:03 -07:00
2022-05-18 18:24:57 -05:00
2023-03-03 16:18:19 -08:00
2023-02-02 22:50:04 -08:00
2022-11-30 20:16:49 -04:00
2022-05-19 23:25:47 -04:00
2023-04-13 11:49:35 -07:00
2023-03-23 12:45:36 +01:00
2023-04-27 16:36:55 -07:00
2022-06-23 18:41:40 +02:00
2022-08-06 16:38:17 -07:00
2023-04-29 09:48:52 -07:00