From: "Zhang Haoyu" <zhanghy@sangfor.com>
To: "Zhang Haoyu" <zhanghy@sangfor.com>,
	"Razya Ladelsky" <RAZYA@il.ibm.com>,
	"Christian Borntraeger" <borntraeger@de.ibm.com>,
	"mashirle" <mashirle@us.ibm.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Michael S.Tsirkin" <mst@redhat.com>
Cc: "abel.gordon" <abel.gordon@gmail.com>,
	"Alex Glikson" <GLIKSON@il.ibm.com>,
	"Eran Raichstein" <ERANRA@il.ibm.com>,
	"Joel Nider" <JOELN@il.ibm.com>, "kvm" <kvm@vger.kernel.org>,
	"linux-kernel" <linux-kernel@vger.kernel.org>,
	"mst" <mst@redhat.com>, "netdev" <netdev@vger.kernel.org>,
	"virtualization" <virtualization@lists.linux-foundation.org>,
	"Yossi Kuperman1" <YOSSIKU@il.ibm.com>
Subject: Re: [PATCH] vhost: Add polling mode
Date: Fri, 22 Aug 2014 18:01:52 +0800	[thread overview]
Message-ID: <201408221801508088964@sangfor.com> (raw)
In-Reply-To: OF9D20825B.8FFA2829-ONC2257D3B.004A777F-C2257D3B.004C47BC@il.ibm.com
>>> > 
>>> > Results:
>>> > 
>>> > Netperf, 1 vm:
>>> > The polling patch improved throughput by ~33% (1516 MB/sec -> 2046 MB/sec).
>>> > Number of exits/sec decreased 6x.
>>> > The same improvement was shown when I tested with 3 vms running netperf
>>> > (4086 MB/sec -> 5545 MB/sec).
>>> > 
>>> > filebench, 1 vm:
>>> > ops/sec improved by 13% with the polling patch. Number of exits 
>>> was reduced by
>>> > 31%.
>>> > The same experiment with 3 vms running filebench showed similar numbers.
>>> > 
>>> > Signed-off-by: Razya Ladelsky <razya@il.ibm.com>
>>> 
>>> Gave it a quick try on s390/kvm. As expected it makes no difference 
>>> for big streaming workload like iperf.
>>> uperf with a 1-1 round robin got indeed faster by about 30%.
>>> The high CPU consumption is something that bothers me though, as 
>>> virtualized systems tend to be full.
>>> 
>>> 
>>
>>Thanks for confirming the results!
>>The best way to use this patch would be along with a shared vhost thread 
>>for multiple
>>devices/vms, as described in:
>>http://domino.research.ibm.com/library/cyberdig.nsf/1e4115aea78b6e7c85256b360066f0d4/479e3578ed05bfac85257b4200427735!OpenDocument
>>This work assumes having a dedicated I/O core where the vhost thread 
>>serves multiple vms, which 
>>makes the high cpu utilization less of a concern. 
>>
>Hi, Razya, Shirley
>I am going to test the combination of 
>"several (depends on total number of cpu on host, e.g.,  total_number * 1/3) vhost threads server all VMs" and "vhost: add polling mode",
>now I get the patch "http://thread.gmane.org/gmane.comp.emulators.kvm.devel/88682/focus=88723" posted by Shirley,
>any update to this patch?
>
>And, I want to make a bit change on this patch, create total_cpu_number * 1/N(N={3,4}) vhost threads instead of per-cpu vhost thread to server all VMs,
Just like xen netback threads, whose number is equal to num_online_cpus on Dom0, 
but for kvm host, I think per-cpu vhost thread is too many.
>any ideas?
>
>Thanks,
>Zhang Haoyu
>>
>>
>>> > +static int poll_start_rate = 0;
>>> > +module_param(poll_start_rate, int, S_IRUGO|S_IWUSR);
>>> > +MODULE_PARM_DESC(poll_start_rate, "Start continuous polling of 
>>> virtqueue when rate of events is at least this number per jiffy. If 
>>> 0, never start polling.");
>>> > +
>>> > +static int poll_stop_idle = 3*HZ; /* 3 seconds */
>>> > +module_param(poll_stop_idle, int, S_IRUGO|S_IWUSR);
>>> > +MODULE_PARM_DESC(poll_stop_idle, "Stop continuous polling of 
>>> virtqueue after this many jiffies of no work.");
>>> 
>>> This seems ridicoudly high. Even one jiffie is an eternity, so 
>>> setting it to 1 as a default would reduce the CPU overhead for most cases.
>>> If we dont have a packet in one millisecond, we can surely go back 
>>> to the kick approach, I think.
>>> 
>>> Christian
>>> 
>>
>>Good point, will reduce it and recheck.
>>Thank you,
>>Razya
next prev parent reply	other threads:[~2014-08-22 10:01 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1407659404-razya@il.ibm.com>
2014-08-10  8:30 ` [PATCH] vhost: Add polling mode Razya Ladelsky
2014-08-10  8:30 ` Razya Ladelsky
2014-08-10 19:45   ` Michael S. Tsirkin
2014-08-11 19:46     ` David Miller
2014-08-12  9:18       ` Michael S. Tsirkin
2014-08-12 10:57         ` Razya Ladelsky
2014-08-13 12:15           ` Michael S. Tsirkin
2014-08-17 12:35             ` Razya Ladelsky
2014-08-17 12:58               ` Michael S. Tsirkin
2014-08-19  8:36                 ` Razya Ladelsky
2014-08-20 11:05                   ` Michael S. Tsirkin
2016-09-04  8:45     ` Razya Ladelsky
2014-08-20  8:41   ` Christian Borntraeger
2014-08-20 10:32     ` Michael S. Tsirkin
2014-08-21 13:53     ` Razya Ladelsky
2014-08-22  9:30       ` Zhang Haoyu
2014-08-22 10:01       ` Zhang Haoyu [this message]
2014-08-20 10:57   ` Michael S. Tsirkin
2014-08-21 14:23     ` Razya Ladelsky
2014-08-21 14:29       ` David Laight
2014-08-24 12:26         ` Razya Ladelsky
2014-08-10  8:30 ` Razya Ladelsky
2014-08-10  8:30 ` Razya Ladelsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox
  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):
  git send-email \
    --in-reply-to=201408221801508088964@sangfor.com \
    --to=zhanghy@sangfor.com \
    --cc=ERANRA@il.ibm.com \
    --cc=GLIKSON@il.ibm.com \
    --cc=JOELN@il.ibm.com \
    --cc=RAZYA@il.ibm.com \
    --cc=YOSSIKU@il.ibm.com \
    --cc=abel.gordon@gmail.com \
    --cc=borntraeger@de.ibm.com \
    --cc=jasowang@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mashirle@us.ibm.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY
  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
  Be sure your reply has a Subject: header at the top and a blank line
  before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).