Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752777AbdI1Kai (ORCPT ); Thu, 28 Sep 2017 06:30:38 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:32995 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751880AbdI1Kah (ORCPT ); Thu, 28 Sep 2017 06:30:37 -0400 X-Google-Smtp-Source: AOwi7QAL/QImsQpqOCTOKBKuZqojFzUZov5yoFthEcvB0DOOwtZujcYIUBchO8bkpMZxmA/r1cqqbw== Date: Thu, 28 Sep 2017 19:30:32 +0900 From: Sergey Senozhatsky To: Peter Zijlstra Cc: Sasha Levin , Thomas Gleixner , Ingo Molnar , "linux-kernel@vger.kernel.org List" , alexander.levin@verizon.com, pmladek@suse.com, sergey.senozhatsky@gmail.com, rostedt@goodmis.org Subject: Re: sched: serial port lockdep warning when offlining CPUs Message-ID: <20170928103032.GA2380@jagdpanzerIV.localdomain> References: <20170928093847.zgcgvxb7ajiaywbr@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170928093847.zgcgvxb7ajiaywbr@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2424 Lines: 71 Hi all, Peter, thanks for Cc-ing. On (09/28/17 11:38), Peter Zijlstra wrote: > On Thu, Sep 28, 2017 at 02:19:46AM -0700, Sasha Levin wrote: > > Hi all, > > > > I seem to be hitting the following warning when offlining CPUs on the > > latest -next kernel: > > > > [289683102.607076] Unregister pv shared memory for cpu 8 > > [289683102.622922] select_fallback_rq: 3 callbacks suppressed > > This is because you hit a printk() from the scheduler, that's known > broken (along with the rest of printk). > > You forgot to actually include that printk() though I suspect it reads > like: > > "process %d (%s) no longer affine to cpu%d\n" > > Now that uses printk_deferred() which _should_ work lots better, but > clearly the printk() stuff went wobbly again. > > > [289683102.626292] vprintk_emit (kernel/printk/printk.c:1876) > > [289683102.626294] vprintk_default (kernel/printk/printk.c:1918) > > [289683102.626295] vprintk_func (kernel/printk/printk_safe.c:382) > > [289683102.626297] printk (kernel/printk/printk.c:1943) > > [289683102.626299] ? show_regs_print_info (kernel/printk/printk.c:1943) > > [289683102.626301] ? lock_acquire (kernel/locking/lockdep.c:4004) > > [289683102.626306] ___ratelimit (lib/ratelimit.c:52) > > [289683102.626309] __printk_ratelimit (kernel/printk/printk.c:2874) > > [289683102.626311] select_fallback_rq (kernel/sched/core.c:1525 (discriminator 1)) > > [289683102.626313] sched_cpu_dying (kernel/sched/core.c:5500 kernel/sched/core.c:5687) > > Also, could you pretty please not line wrap logs? I think it's if (p->mm && printk_ratelimit()) which calls int ___ratelimit(), which ends up doing pr_warn("%s: %d callbacks suppressed\n", func, rs->missed); which is a "normal" printk from within the scheduler. out of curiosity, will the following fix the warning --- lib/ratelimit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ratelimit.c b/lib/ratelimit.c index 08f8043cac61..bddc55834c2e 100644 --- a/lib/ratelimit.c +++ b/lib/ratelimit.c @@ -48,7 +48,8 @@ int ___ratelimit(struct ratelimit_state *rs, const char *func) if (time_is_before_jiffies(rs->begin + rs->interval)) { if (rs->missed) { if (!(rs->flags & RATELIMIT_MSG_ON_RELEASE)) { - pr_warn("%s: %d callbacks suppressed\n", func, rs->missed); + printk_deferred(KERN_WARN "%s: %d callbacks suppressed\n", + func, rs->missed); rs->missed = 0; } }