From: Chengming Zhou <zhouchengming@bytedance.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org, pmladek@suse.com,
sergey.senozhatsky@gmail.com, rostedt@goodmis.org,
mingo@redhat.com, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
bsegall@google.com, mgorman@suse.de, songmuchun@bytedance.com
Subject: Re: [External] Re: [PATCH 2/2] sched: mark PRINTK_DEFERRED_CONTEXT_MASK in __schedule()
Date: Mon, 28 Sep 2020 16:54:53 +0800 [thread overview]
Message-ID: <40ab934e-5b8b-735b-da65-3043efab9fdc@bytedance.com> (raw)
In-Reply-To: <20200928073202.GA2611@hirez.programming.kicks-ass.net>
在 2020/9/28 下午3:32, Peter Zijlstra 写道:
> On Mon, Sep 28, 2020 at 12:11:30AM +0800, Chengming Zhou wrote:
>> The WARN_ON/WARN_ON_ONCE with rq lock held in __schedule() should be
>> deferred by marking the PRINTK_DEFERRED_CONTEXT_MASK, or will cause
>> deadlock on rq lock in the printk path.
> It also shouldn't happen in the first place, so who bloody cares.
Yes, but if our box deadlock just because a WARN_ON_ONCE, we have to
reboot : (
So these WARN_ON_ONCE have BUG_ON effect ? Or we should change to use
BUG_ON ?
Thanks.
>> Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
>> Signed-off-by: Muchun Song <songmuchun@bytedance.com>
>> ---
>> kernel/sched/core.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
>> index 2d95dc3f4644..81d8bf614225 100644
>> --- a/kernel/sched/core.c
>> +++ b/kernel/sched/core.c
>> @@ -4444,6 +4444,7 @@ static void __sched notrace __schedule(bool preempt)
>> */
>> rq_lock(rq, &rf);
>> smp_mb__after_spinlock();
>> + printk_deferred_enter();
>>
>> /* Promote REQ to ACT */
>> rq->clock_update_flags <<= 1;
>> @@ -4530,6 +4531,7 @@ static void __sched notrace __schedule(bool preempt)
>> rq_unlock_irq(rq, &rf);
>> }
>>
>> + printk_deferred_exit();
>> balance_callback(rq);
>> }
> NAK printk_deferred is an abomination, kill that.
next prev parent reply other threads:[~2020-09-28 8:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-27 16:11 [PATCH 1/2] printk: Add printk_deferred_{enter, exit} Chengming Zhou
2020-09-27 16:11 ` [PATCH 2/2] sched: mark PRINTK_DEFERRED_CONTEXT_MASK in __schedule() Chengming Zhou
2020-09-28 7:32 ` Peter Zijlstra
2020-09-28 7:52 ` Joe Perches
2020-09-28 8:00 ` Peter Zijlstra
2020-09-28 8:06 ` Peter Zijlstra
2020-09-28 8:54 ` Chengming Zhou [this message]
2020-09-28 9:01 ` [External] " Peter Zijlstra
2020-09-28 10:04 ` Chengming Zhou
2020-09-28 10:25 ` Peter Zijlstra
2020-09-28 23:50 ` Sergey Senozhatsky
2020-09-29 14:27 ` Petr Mladek
2020-09-29 15:09 ` Peter Zijlstra
2020-09-30 0:48 ` Sergey Senozhatsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40ab934e-5b8b-735b-da65-3043efab9fdc@bytedance.com \
--to=zhouchengming@bytedance.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=sergey.senozhatsky@gmail.com \
--cc=songmuchun@bytedance.com \
--cc=vincent.guittot@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).