Re: [PATCH net 2/4] vhost_net: rework on the lock ordering for busy polling

2018-12-11 Thread Michael S. Tsirkin
On Wed, Dec 12, 2018 at 11:03:57AM +0800, Jason Wang wrote: > > On 2018/12/11 下午12:04, Michael S. Tsirkin wrote: > > On Tue, Dec 11, 2018 at 11:06:43AM +0800, Jason Wang wrote: > > > On 2018/12/11 上午9:34, Michael S. Tsirkin wrote: > > > > On Mon, Dec 10, 2018 at 05:44:52PM +0800, Jason Wang wrote:

Re: [PATCH net 2/4] vhost_net: rework on the lock ordering for busy polling

2018-12-11 Thread Jason Wang
On 2018/12/11 下午12:04, Michael S. Tsirkin wrote: On Tue, Dec 11, 2018 at 11:06:43AM +0800, Jason Wang wrote: On 2018/12/11 上午9:34, Michael S. Tsirkin wrote: On Mon, Dec 10, 2018 at 05:44:52PM +0800, Jason Wang wrote: When we try to do rx busy polling in tx path in commit 441abde4cd84 ("net:

Re: [PATCH net 2/4] vhost_net: rework on the lock ordering for busy polling

2018-12-10 Thread Michael S. Tsirkin
On Tue, Dec 11, 2018 at 11:06:43AM +0800, Jason Wang wrote: > > On 2018/12/11 上午9:34, Michael S. Tsirkin wrote: > > On Mon, Dec 10, 2018 at 05:44:52PM +0800, Jason Wang wrote: > > > When we try to do rx busy polling in tx path in commit 441abde4cd84 > > > ("net: vhost: add rx busy polling in tx pa

Re: [PATCH net 2/4] vhost_net: rework on the lock ordering for busy polling

2018-12-10 Thread Jason Wang
On 2018/12/11 上午9:34, Michael S. Tsirkin wrote: On Mon, Dec 10, 2018 at 05:44:52PM +0800, Jason Wang wrote: When we try to do rx busy polling in tx path in commit 441abde4cd84 ("net: vhost: add rx busy polling in tx path"), we lock rx vq mutex after tx vq mutex is held. This may lead deadlock

Re: [PATCH net 2/4] vhost_net: rework on the lock ordering for busy polling

2018-12-10 Thread Michael S. Tsirkin
On Mon, Dec 10, 2018 at 05:44:52PM +0800, Jason Wang wrote: > When we try to do rx busy polling in tx path in commit 441abde4cd84 > ("net: vhost: add rx busy polling in tx path"), we lock rx vq mutex > after tx vq mutex is held. This may lead deadlock so we try to lock vq > one by one in commit 781

[PATCH net 2/4] vhost_net: rework on the lock ordering for busy polling

2018-12-10 Thread Jason Wang
When we try to do rx busy polling in tx path in commit 441abde4cd84 ("net: vhost: add rx busy polling in tx path"), we lock rx vq mutex after tx vq mutex is held. This may lead deadlock so we try to lock vq one by one in commit 78139c94dc8c ("net: vhost: lock the vqs one by one"). With this commit,