Re: [External] Re: [PATCH 2/2] sched: mark PRINTK_DEFERRED_CONTEXT_MASK in __schedule()

2020-09-29 Thread Sergey Senozhatsky
On (20/09/29 17:09), Peter Zijlstra wrote: > > 2. The registration and unregistration of consoles should not longer > >be handled by console_lock (semaphore). It should be possible to > >call most consoles without a sleeping lock. It should remove all > >these deadlocks between printk()

Re: [External] Re: [PATCH 2/2] sched: mark PRINTK_DEFERRED_CONTEXT_MASK in __schedule()

2020-09-29 Thread Peter Zijlstra
On Tue, Sep 29, 2020 at 04:27:51PM +0200, Petr Mladek wrote: > Upstreaming the console handling will be the next big step. I am sure > that there will be long discussion about it. But there might be > few things that would help removing printk_deferred(). > > 1. Messages will be printed on consol

Re: [External] Re: [PATCH 2/2] sched: mark PRINTK_DEFERRED_CONTEXT_MASK in __schedule()

2020-09-29 Thread Petr Mladek
On Mon 2020-09-28 12:25:59, Peter Zijlstra wrote: > On Mon, Sep 28, 2020 at 06:04:23PM +0800, Chengming Zhou wrote: > > > Well, you are lucky. So it's a problem in our printk implementation. > > Not lucky; I just kicked it in the groin really hard: > > git://git.kernel.org/pub/scm/linux/kernel

Re: [External] Re: [PATCH 2/2] sched: mark PRINTK_DEFERRED_CONTEXT_MASK in __schedule()

2020-09-28 Thread Sergey Senozhatsky
On (20/09/28 12:25), Peter Zijlstra wrote: [..] > > printk > >   vprintk_emit > >     console_unlock > >       vt_console_print > >         hide_cursor > >           bit_cursor > >             soft_cursor > >               queue_work_on > >                 __queue_work > >                   try_to_

Re: [External] Re: [PATCH 2/2] sched: mark PRINTK_DEFERRED_CONTEXT_MASK in __schedule()

2020-09-28 Thread Peter Zijlstra
On Mon, Sep 28, 2020 at 06:04:23PM +0800, Chengming Zhou wrote: > Well, you are lucky. So it's a problem in our printk implementation. Not lucky; I just kicked it in the groin really hard: git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git debug/experimental > The deadlock path i

Re: [External] Re: [PATCH 2/2] sched: mark PRINTK_DEFERRED_CONTEXT_MASK in __schedule()

2020-09-28 Thread Chengming Zhou
在 2020/9/28 下午5:01, Peter Zijlstra 写道: > On Mon, Sep 28, 2020 at 04:54:53PM +0800, Chengming Zhou wrote: >> 在 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 def

Re: [External] Re: [PATCH 2/2] sched: mark PRINTK_DEFERRED_CONTEXT_MASK in __schedule()

2020-09-28 Thread Peter Zijlstra
On Mon, Sep 28, 2020 at 04:54:53PM +0800, Chengming Zhou wrote: > > 在 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_CONT

Re: [External] Re: [PATCH 2/2] sched: mark PRINTK_DEFERRED_CONTEXT_MASK in __schedule()

2020-09-28 Thread Chengming Zhou
在 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 a

Re: [PATCH 2/2] sched: mark PRINTK_DEFERRED_CONTEXT_MASK in __schedule()

2020-09-28 Thread Peter Zijlstra
On Mon, Sep 28, 2020 at 10:00:22AM +0200, Peter Zijlstra wrote: > On Mon, Sep 28, 2020 at 12:52:44AM -0700, Joe Perches wrote: > > On Mon, 2020-09-28 at 09:32 +0200, Peter Zijlstra wrote: > > > On Mon, Sep 28, 2020 at 12:11:30AM +0800, Chengming Zhou wrote: > > > > The WARN_ON/WARN_ON_ONCE with rq

Re: [PATCH 2/2] sched: mark PRINTK_DEFERRED_CONTEXT_MASK in __schedule()

2020-09-28 Thread Peter Zijlstra
On Mon, Sep 28, 2020 at 12:52:44AM -0700, Joe Perches wrote: > On Mon, 2020-09-28 at 09:32 +0200, Peter Zijlstra wrote: > > 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

Re: [PATCH 2/2] sched: mark PRINTK_DEFERRED_CONTEXT_MASK in __schedule()

2020-09-28 Thread Joe Perches
On Mon, 2020-09-28 at 09:32 +0200, Peter Zijlstra wrote: > 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

Re: [PATCH 2/2] sched: mark PRINTK_DEFERRED_CONTEXT_MASK in __schedule()

2020-09-28 Thread 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

[PATCH 2/2] sched: mark PRINTK_DEFERRED_CONTEXT_MASK in __schedule()

2020-09-27 Thread Chengming Zhou
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. Signed-off-by: Chengming Zhou Signed-off-by: Muchun Song --- kernel/sched/core.c | 2 ++ 1 file changed, 2 insertions(