Re: netconsole deadlock with virtnet

2020-11-24 Thread Jason Wang
On 2020/11/25 上午12:20, Jakub Kicinski wrote: On Tue, 24 Nov 2020 11:22:03 +0800 Jason Wang wrote: Perhaps you need the trylock in virtnet_poll_tx()? That could work. Best if we used normal lock if !!budget, and trylock when budget is 0. But maybe that's too hairy. If we use trylock, we proba

Re: netconsole deadlock with virtnet

2020-11-24 Thread Jason Wang
On 2020/11/24 下午10:31, Steven Rostedt wrote: On Tue, 24 Nov 2020 11:22:03 +0800 Jason Wang wrote: Btw, have a quick search, there are several other drivers that uses tx lock in the tx NAPI. tx NAPI is not the issue. The issue is that write_msg() (in netconsole.c) calls this polling logic wi

Re: netconsole deadlock with virtnet

2020-11-24 Thread Jakub Kicinski
On Tue, 24 Nov 2020 11:22:03 +0800 Jason Wang wrote: > >> Perhaps you need the trylock in virtnet_poll_tx()? > > That could work. Best if we used normal lock if !!budget, and trylock > > when budget is 0. But maybe that's too hairy. > > If we use trylock, we probably lose(or delay) tx notifica

Re: netconsole deadlock with virtnet

2020-11-24 Thread Steven Rostedt
On Tue, 24 Nov 2020 11:22:03 +0800 Jason Wang wrote: > Btw, have a quick search, there are several other drivers that uses tx > lock in the tx NAPI. tx NAPI is not the issue. The issue is that write_msg() (in netconsole.c) calls this polling logic with the target_list_lock held. Are those othe

Re: netconsole deadlock with virtnet

2020-11-24 Thread Leon Romanovsky
On Tue, Nov 24, 2020 at 04:57:23PM +0800, Jason Wang wrote: > > On 2020/11/24 下午4:01, Leon Romanovsky wrote: > > On Tue, Nov 24, 2020 at 11:22:03AM +0800, Jason Wang wrote: > > > On 2020/11/24 上午3:21, Jakub Kicinski wrote: > > > > On Mon, 23 Nov 2020 14:09:34 -0500 Steven Rostedt wrote: > > > > > O

Re: netconsole deadlock with virtnet

2020-11-24 Thread Jason Wang
On 2020/11/24 下午4:01, Leon Romanovsky wrote: On Tue, Nov 24, 2020 at 11:22:03AM +0800, Jason Wang wrote: On 2020/11/24 上午3:21, Jakub Kicinski wrote: On Mon, 23 Nov 2020 14:09:34 -0500 Steven Rostedt wrote: On Mon, 23 Nov 2020 10:52:52 -0800 Jakub Kicinski wrote: On Mon, 23 Nov 2020 09:31:

Re: netconsole deadlock with virtnet

2020-11-24 Thread Leon Romanovsky
On Tue, Nov 24, 2020 at 11:22:03AM +0800, Jason Wang wrote: > > On 2020/11/24 上午3:21, Jakub Kicinski wrote: > > On Mon, 23 Nov 2020 14:09:34 -0500 Steven Rostedt wrote: > > > On Mon, 23 Nov 2020 10:52:52 -0800 > > > Jakub Kicinski wrote: > > > > > > > On Mon, 23 Nov 2020 09:31:28 -0500 Steven Rost

Re: netconsole deadlock with virtnet

2020-11-23 Thread Jason Wang
On 2020/11/24 上午3:21, Jakub Kicinski wrote: On Mon, 23 Nov 2020 14:09:34 -0500 Steven Rostedt wrote: On Mon, 23 Nov 2020 10:52:52 -0800 Jakub Kicinski wrote: On Mon, 23 Nov 2020 09:31:28 -0500 Steven Rostedt wrote: On Mon, 23 Nov 2020 13:08:55 +0200 Leon Romanovsky wrote: [ 10

Re: netconsole deadlock with virtnet

2020-11-23 Thread Jakub Kicinski
On Mon, 23 Nov 2020 14:09:34 -0500 Steven Rostedt wrote: > On Mon, 23 Nov 2020 10:52:52 -0800 > Jakub Kicinski wrote: > > > On Mon, 23 Nov 2020 09:31:28 -0500 Steven Rostedt wrote: > > > On Mon, 23 Nov 2020 13:08:55 +0200 > > > Leon Romanovsky wrote: > > > > > > > > > > [ 10.028024] C

Re: netconsole deadlock with virtnet

2020-11-23 Thread Steven Rostedt
On Mon, 23 Nov 2020 10:52:52 -0800 Jakub Kicinski wrote: > On Mon, 23 Nov 2020 09:31:28 -0500 Steven Rostedt wrote: > > On Mon, 23 Nov 2020 13:08:55 +0200 > > Leon Romanovsky wrote: > > > > > > > [ 10.028024] Chain exists of: > > > [ 10.028025] console_owner --> target_list_lock -->

Re: netconsole deadlock with virtnet

2020-11-23 Thread Jakub Kicinski
On Mon, 23 Nov 2020 09:31:28 -0500 Steven Rostedt wrote: > On Mon, 23 Nov 2020 13:08:55 +0200 > Leon Romanovsky wrote: > > > > [ 10.028024] Chain exists of: > > [ 10.028025] console_owner --> target_list_lock --> _xmit_ETHER#2 > > Note, the problem is that we have a location that grab

Re: netconsole deadlock with virtnet

2020-11-23 Thread Steven Rostedt
On Mon, 23 Nov 2020 13:08:55 +0200 Leon Romanovsky wrote: > [ 10.028024] Chain exists of: > [ 10.028025] console_owner --> target_list_lock --> _xmit_ETHER#2 Note, the problem is that we have a location that grabs the xmit_lock while holding target_list_lock (and possibly console_owner)

Re: netconsole deadlock with virtnet

2020-11-23 Thread Leon Romanovsky
On Wed, Nov 18, 2020 at 09:12:57AM -0500, Steven Rostedt wrote: > > [ Adding netdev as perhaps someone there knows ] > > On Wed, 18 Nov 2020 12:09:59 +0800 > Jason Wang wrote: > > > > This CPU0 lock(_xmit_ETHER#2) -> hard IRQ -> lock(console_owner) is > > > basically > > > soft IRQ -> lock(_xmit

Re: netconsole deadlock with virtnet

2020-11-18 Thread Steven Rostedt
[ Adding netdev as perhaps someone there knows ] On Wed, 18 Nov 2020 12:09:59 +0800 Jason Wang wrote: > > This CPU0 lock(_xmit_ETHER#2) -> hard IRQ -> lock(console_owner) is > > basically > > soft IRQ -> lock(_xmit_ETHER#2) -> hard IRQ -> printk() > > > > Then CPU1 spins on xmit, which is