Re: [PATCH net-next v3 1/4] net: vhost: lock the vqs one by one

2018-07-01 Thread Jason Wang
On 2018年06月30日 14:33, xiangxia.m@gmail.com wrote: From: Tonghao Zhang This patch changes the way that lock all vqs at the same, to lock them one by one. It will be used for next patch to avoid the deadlock. Signed-off-by: Tonghao Zhang --- drivers/vhost/vhost.c | 24 +++---

Re: [PATCH net-next v3 2/4] net: vhost: replace magic number of lock annotation

2018-07-01 Thread Jason Wang
On 2018年06月30日 14:33, xiangxia.m@gmail.com wrote: From: Tonghao Zhang Use the VHOST_NET_VQ_XXX as a subclass for mutex_lock_nested. Signed-off-by: Tonghao Zhang --- drivers/vhost/net.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/vhost/net.c b/dri

Re: [PATCH net-next v3 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()

2018-07-01 Thread Jason Wang
On 2018年06月30日 14:33, xiangxia.m@gmail.com wrote: From: Tonghao Zhang Factor out generic busy polling logic and will be used for tx path in the next patch. And with the patch, qemu can set differently the busyloop_timeout for rx queue. Signed-off-by: Tonghao Zhang --- drivers/vhost/ne

Re: [PATCH net-next v3 4/4] net: vhost: add rx busy polling in tx path

2018-07-01 Thread Jason Wang
On 2018年06月30日 14:33, xiangxia.m@gmail.com wrote: From: Tonghao Zhang This patch improves the guest receive and transmit performance. On the handle_tx side, we poll the sock receive queue at the same time. handle_rx do that in the same way. We set the poll-us=100us and use the iperf3 to

Re: [PATCH vhost] vhost_net: Fix too many vring kick on busypoll

2018-07-01 Thread Jason Wang
On 2018年06月30日 00:38, Michael S. Tsirkin wrote: On Fri, Jun 29, 2018 at 05:09:50PM +0900, Toshiaki Makita wrote: Under heavy load vhost busypoll may run without suppressing notification. For example tx zerocopy callback can push tx work while handle_tx() is running, then busyloop exits due to

Re: [PATCH vhost] vhost_net: Fix too many vring kick on busypoll

2018-07-01 Thread Toshiaki Makita
Hi Jason, On 2018/06/29 18:30, Jason Wang wrote: > On 2018年06月29日 16:09, Toshiaki Makita wrote: ... >> To fix this, poll the work instead of enabling notification when >> busypoll is interrupted by something. IMHO signal_pending() and >> vhost_has_work() are kind of interruptions rather than signa

Re: [PATCH vhost] vhost_net: Fix too many vring kick on busypoll

2018-07-01 Thread Toshiaki Makita
On 2018/07/02 11:41, Jason Wang wrote: > On 2018年06月30日 00:38, Michael S. Tsirkin wrote: >> On Fri, Jun 29, 2018 at 05:09:50PM +0900, Toshiaki Makita wrote: >>> Under heavy load vhost busypoll may run without suppressing >>> notification. For example tx zerocopy callback can push tx work while >>>

Re: [PATCH vhost] vhost_net: Fix too many vring kick on busypoll

2018-07-01 Thread Jason Wang
On 2018年07月02日 10:45, Toshiaki Makita wrote: Hi Jason, On 2018/06/29 18:30, Jason Wang wrote: On 2018年06月29日 16:09, Toshiaki Makita wrote: ... To fix this, poll the work instead of enabling notification when busypoll is interrupted by something. IMHO signal_pending() and vhost_has_work() ar

Re: [PATCH vhost] vhost_net: Fix too many vring kick on busypoll

2018-07-01 Thread Toshiaki Makita
On 2018/06/30 1:38, Michael S. Tsirkin wrote: ... >> Performance numbers: >> >> - Bulk transfer from guest to external physical server. >> [Guest]->vhost_net->tap--(XDP_REDIRECT)-->i40e --(wire)--> [Server] >> - Set 10us busypoll. >> - Guest disables checksum and TSO because of host XDP. >> - M

Re: [PATCH vhost] vhost_net: Fix too many vring kick on busypoll

2018-07-01 Thread Jason Wang
On 2018年07月02日 10:52, Toshiaki Makita wrote: On 2018/07/02 11:41, Jason Wang wrote: On 2018年06月30日 00:38, Michael S. Tsirkin wrote: On Fri, Jun 29, 2018 at 05:09:50PM +0900, Toshiaki Makita wrote: Under heavy load vhost busypoll may run without suppressing notification. For example tx zeroco

Re: [PATCH net-next v3 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()

2018-07-01 Thread Tonghao Zhang
On Mon, Jul 2, 2018 at 10:29 AM Jason Wang wrote: > > > > On 2018年06月30日 14:33, xiangxia.m@gmail.com wrote: > > From: Tonghao Zhang > > > > Factor out generic busy polling logic and will be > > used for tx path in the next patch. And with the patch, > > qemu can set differently the busyloop_t

Re: [PATCH vhost] vhost_net: Fix too many vring kick on busypoll

2018-07-01 Thread Toshiaki Makita
On 2018/07/02 11:54, Jason Wang wrote: > On 2018年07月02日 10:45, Toshiaki Makita wrote: >> Hi Jason, >> >> On 2018/06/29 18:30, Jason Wang wrote: >>> On 2018年06月29日 16:09, Toshiaki Makita wrote: >> ... To fix this, poll the work instead of enabling notification when busypoll is interrupted

Re: [PATCH vhost] vhost_net: Fix too many vring kick on busypoll

2018-07-01 Thread Jason Wang
On 2018年07月02日 12:37, Toshiaki Makita wrote: On 2018/07/02 11:54, Jason Wang wrote: On 2018年07月02日 10:45, Toshiaki Makita wrote: Hi Jason, On 2018/06/29 18:30, Jason Wang wrote: On 2018年06月29日 16:09, Toshiaki Makita wrote: ... To fix this, poll the work instead of enabling notification wh