From 12eced009494088fafed57ba89c96d29ba1cc1d0 Mon Sep 17 00:00:00 2001 From: Isaku Yamahata Date: Mon, 11 Apr 2022 12:19:08 -0700 Subject: [PATCH] [REVERTME] comment out pr_info() that causes lockdep error Without this patch, lockdep complains as follows and disable it. ============================= [ BUG: Invalid wait context ] 5.18.0-rc1 #171 Not tainted ----------------------------- swapper/0/1 is trying to lock: ffffffff978f7978 (&port_lock_key){....}-{3:3}, at: serial8250_console_write+0x557/0x610 other info that might help us debug this: context-{5:5} 3 locks held by swapper/0/1: #0: ffffffff95a9ab48 (rcu_tasks.cbs_gbl_lock){....}-{2:2}, at: cblist_init_generic+0x29/0x310 #1: ffffffff95a86d60 (console_lock){+.+.}-{0:0}, at: vprintk_emit+0x153/0x200 #2: ffffffff959a66c0 (console_owner){....}-{0:0}, at: console_unlock+0x27a/0x620 stack backtrace: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.18.0-rc1-yamahata-kvm-upstream+ #171 eb656e2c6a2533f980e80fcf0fe9314dd3ea2a22 Hardware name: Intel Corporation EAGLESTREAM/EAGLESTREAM, BIOS EGSDCRB1.SYS.0066.D24.2110072326 10/07/2021 Call Trace: show_stack+0x52/0x58 dump_stack_lvl+0x5b/0x82 dump_stack+0x10/0x12 check_wait_context.cold+0xc0/0xfe __lock_acquire+0x222/0x990 lock_acquire.part.0+0x126/0x2f0 ? serial8250_console_write+0x557/0x610 ? rcu_read_unlock+0x50/0x50 ? check_prev_add+0x1270/0x1270 ? __this_cpu_preempt_check+0x13/0x20 lock_acquire+0x8f/0x180 ? serial8250_console_write+0x557/0x610 _raw_spin_lock_irqsave+0x43/0x60 ? serial8250_console_write+0x557/0x610 serial8250_console_write+0x557/0x610 ? serial8250_config_port+0x210/0x210 ? rcu_read_unlock+0x50/0x50 ? __lock_release+0x14d/0x2d0 ? record_print_text+0x206/0x260 ? console_unlock+0x2a5/0x620 ? __this_cpu_preempt_check+0x13/0x20 univ8250_console_write+0x4b/0x60 call_console_drivers.constprop.0+0x180/0x250 console_unlock+0x2d0/0x620 ? console_unlock+0x27a/0x620 ? devkmsg_read+0x420/0x420 ? __down_trylock_console_sem+0x7c/0xc0 ? vprintk_emit+0x153/0x200 vprintk_emit+0x1a4/0x200 vprintk_default+0x1d/0x20 vprintk+0x4e/0x60 _printk+0xb2/0xe3 ? record_print_text.cold+0x11/0x11 ? rwlock_bug.part.0+0x60/0x60 ? lock_acquire+0x8f/0x180 ? cblist_init_generic+0x29/0x310 ? do_raw_spin_lock+0x11e/0x1b0 ? do_raw_spin_lock+0x109/0x1b0 cblist_init_generic.cold+0x44/0x52 rcu_init_tasks_generic+0x15/0x164 kernel_init_freeable+0x103/0x1ba ? rest_init+0x340/0x340 kernel_init+0x1f/0x170 ? rest_init+0x340/0x340 ret_from_fork+0x1f/0x30 Signed-off-by: Isaku Yamahata --- kernel/rcu/tasks.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h index fe9840d90e9601..65e0e7dc6c4006 100644 --- a/kernel/rcu/tasks.h +++ b/kernel/rcu/tasks.h @@ -233,7 +233,7 @@ static void cblist_init_generic(struct rcu_tasks *rtp) if (rcu_task_enqueue_lim < 0) { rcu_task_enqueue_lim = 1; rcu_task_cb_adjust = true; - pr_info("%s: Setting adjustable number of callback queues.\n", __func__); + //pr_info("%s: Setting adjustable number of callback queues.\n", __func__); } else if (rcu_task_enqueue_lim == 0) { rcu_task_enqueue_lim = 1; } @@ -264,7 +264,7 @@ static void cblist_init_generic(struct rcu_tasks *rtp) raw_spin_unlock_rcu_node(rtpcp); // irqs remain disabled. } raw_spin_unlock_irqrestore(&rtp->cbs_gbl_lock, flags); - pr_info("%s: Setting shift to %d and lim to %d.\n", __func__, data_race(rtp->percpu_enqueue_shift), data_race(rtp->percpu_enqueue_lim)); + //pr_info("%s: Setting shift to %d and lim to %d.\n", __func__, data_race(rtp->percpu_enqueue_shift), data_race(rtp->percpu_enqueue_lim)); } // IRQ-work handler that does deferred wakeup for call_rcu_tasks_generic().