From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Wang Subject: Re: [PATCH net-next v2] net: vhost: improve performance when enable busyloop Date: Thu, 28 Jun 2018 12:40:10 +0800 Message-ID: References: <1529990276-61157-1-git-send-email-xiangxia.m.yue@gmail.com> <369bea44-6ebd-337a-b20b-a28a604fa2e9@redhat.com> <20180627185543-mutt-send-email-mst@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Cc: xiangxia.m.yue@gmail.com, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, Tonghao Zhang To: "Michael S. Tsirkin" Return-path: Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38460 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752881AbeF1EkT (ORCPT ); Thu, 28 Jun 2018 00:40:19 -0400 In-Reply-To: <20180627185543-mutt-send-email-mst@kernel.org> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 2018年06月27日 23:58, Michael S. Tsirkin wrote: > On Wed, Jun 27, 2018 at 10:24:43PM +0800, Jason Wang wrote: >> >> On 2018年06月26日 13:17, xiangxia.m.yue@gmail.com wrote: >>> From: Tonghao Zhang >>> >>> This patch improves the guest receive performance from >>> host. On the handle_tx side, we poll the sock receive >>> queue at the same time. handle_rx do that in the same way. >>> >>> For avoiding deadlock, change the code to lock the vq one >>> by one and use the VHOST_NET_VQ_XX as a subclass for >>> mutex_lock_nested. With the patch, qemu can set differently >>> the busyloop_timeout for rx or tx queue. >>> >>> We set the poll-us=100us and use the iperf3 to test >>> its throughput. The iperf3 command is shown as below. >>> >>> on the guest: >>> iperf3 -s -D >>> >>> on the host: >>> iperf3 -c 192.168.1.100 -i 1 -P 10 -t 10 -M 1400 >>> >>> * With the patch: 23.1 Gbits/sec >>> * Without the patch: 12.7 Gbits/sec >>> >>> Signed-off-by: Tonghao Zhang >> Thanks a lot for the patch. Looks good generally, but please split this big >> patch into separate ones like: >> >> patch 1: lock vqs one by one >> patch 2: replace magic number of lock annotation >> patch 3: factor out generic busy polling logic to vhost_net_busy_poll() >> patch 4: add rx busy polling in tx path. >> >> And please cc Michael in v3. >> >> Thanks > Pls include host CPU utilization numbers. You can get them e.g. using > vmstat. I suspect we also want the polling controllable e.g. through > an ioctl. > I believe we had an ioctl for setting timeout? Or you want another kind of controlling. Thanks