Re: [PATCH] blktrace: fix 'BUG: sleeping function called from invalid context' in case of PREEMPT_RT

2020-12-15 Thread Sebastian Andrzej Siewior
On 2020-12-15 20:06:04 [+0800], Ming Lei wrote: > > [ 284.527619] BUG: sleeping function called from invalid context at > kernel/locking/rtmutex.c:968 > [ 284.527626] in_atomic(): 1, irqs_disabled(): 0, pid: 6705, name: mandb > [ 284.527631] 4 locks held by mandb/6705: > [ 284.527634] #0:

Re: [PATCH] blktrace: fix 'BUG: sleeping function called from invalid context' in case of PREEMPT_RT

2020-12-15 Thread Ming Lei
On Mon, Dec 14, 2020 at 10:24:22AM -0500, Steven Rostedt wrote: > On Mon, 14 Dec 2020 10:22:17 +0800 > Ming Lei wrote: > > > trace_note_tsk() is called by __blk_add_trace(), which is covered by RCU > > read lock. > > So in case of PREEMPT_RT, warning of 'BUG: sleeping function called from > >

Re: [PATCH] blktrace: fix 'BUG: sleeping function called from invalid context' in case of PREEMPT_RT

2020-12-14 Thread Steven Rostedt
On Mon, 14 Dec 2020 10:22:17 +0800 Ming Lei wrote: > trace_note_tsk() is called by __blk_add_trace(), which is covered by RCU read > lock. > So in case of PREEMPT_RT, warning of 'BUG: sleeping function called from > invalid context' > will be triggered because spin lock is converted to

[PATCH] blktrace: fix 'BUG: sleeping function called from invalid context' in case of PREEMPT_RT

2020-12-13 Thread Ming Lei
trace_note_tsk() is called by __blk_add_trace(), which is covered by RCU read lock. So in case of PREEMPT_RT, warning of 'BUG: sleeping function called from invalid context' will be triggered because spin lock is converted to rtmutex. Fix the issue by converting running_trace_lock into