All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2][RFC] vhost: improve transmit rate with virtqueue polling
@ 2012-02-17 23:02 Anthony Liguori
  2012-02-17 23:02 ` [PATCH 1/2] vhost: allow multiple workers threads Anthony Liguori
  2012-02-17 23:02 ` [PATCH 2/2] vhost-net: add a spin_threshold parameter Anthony Liguori
  0 siblings, 2 replies; 23+ messages in thread
From: Anthony Liguori @ 2012-02-17 23:02 UTC (permalink / raw)
  To: netdev; +Cc: Michael Tsirkin

Hi,

We've been studying small packet performance under KVM.  Currently, this type of
workload performs fairly poorly in KVM compared to other hypervisors.

After a lot of study, we concluded that two factors currently are bottlenecking
performance.

1) vhost uses a single thread to read both the transmit and receive rings.  The
   code is clearly structured to support multiple threads but only does a single
   thread today.  As these patches show, this has a significant affect on
   performance when running a two VCPU Linux guest under KVM.

2) When dealing with a workload like multiple TCP_RR instances, we process
   packets off the transmit queue too quickly.  It seems to be rare to actually
   get significant batching.  vhost does not use a timer for TX mitigation
   instead relying on scheduling latency to encourage batching.  But in an
   unloaded system, the vhost thread simply gets scheduled too quickly and the
   exit cost dominates the workload.

   In the second patch, we introduce an mechanism to poll the transmit ring for
   a short period of time.  While this series doesn't show it, in our testing
   with similar code, this can have a dramatic affect on throughput.

The second patch does manual tuning but we have a third patch that uses a simple
adaptive algorithm.  I'll follow up soon with this patch and results for it.

We're looking to get some feedback on the approach here.  I think the first
patch should be pretty non-controversial (other than the broadcast wake-up).

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2012-03-12  8:12 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-17 23:02 [PATCH 0/2][RFC] vhost: improve transmit rate with virtqueue polling Anthony Liguori
2012-02-17 23:02 ` [PATCH 1/2] vhost: allow multiple workers threads Anthony Liguori
2012-02-19 14:41   ` Michael S. Tsirkin
2012-02-20 15:50     ` Tom Lendacky
2012-02-20 19:27       ` Michael S. Tsirkin
2012-02-20 19:46         ` Anthony Liguori
2012-02-20 21:00           ` Michael S. Tsirkin
2012-02-21  1:04             ` Shirley Ma
2012-02-21  3:21               ` Michael S. Tsirkin
2012-02-21  4:03                 ` Shirley Ma
2012-03-05 13:21                   ` Anthony Liguori
2012-03-05 20:43                     ` Shirley Ma
2012-02-21  4:32           ` Jason Wang
2012-02-21  4:51     ` Jason Wang
2012-02-17 23:02 ` [PATCH 2/2] vhost-net: add a spin_threshold parameter Anthony Liguori
2012-02-19 14:51   ` Michael S. Tsirkin
2012-02-21  1:35     ` Shirley Ma
2012-02-21  5:34       ` Jason Wang
2012-02-21  6:28         ` Shirley Ma
2012-02-21  6:38           ` Jason Wang
2012-02-21 11:09             ` Shirley Ma
2012-02-21 16:08             ` Sridhar Samudrala
2012-03-12  8:12   ` Dor Laor

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.