All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: Sasha Levin <levinsasha928@gmail.com>,
	krkumar2@in.ibm.com, habanero@linux.vnet.ibm.com,
	mashirle@us.ibm.com, kvm@vger.kernel.org, mst@redhat.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, edumazet@google.com,
	tahm@linux.vnet.ibm.com, jwhan@filewood.snu.ac.kr,
	davem@davemloft.net, sri@us.ibm.com
Subject: Re: [net-next RFC V5 5/5] virtio_net: support negotiating the number of queues through ctrl vq
Date: Fri, 06 Jul 2012 17:26:45 +0800	[thread overview]
Message-ID: <4FF6AF55.9080908@redhat.com> (raw)
In-Reply-To: <20120705233816.3ec0b827@nehalam.linuxnetplumber.net>

On 07/06/2012 02:38 PM, Stephen Hemminger wrote:
> On Fri, 06 Jul 2012 11:20:06 +0800
> Jason Wang<jasowang@redhat.com>  wrote:
>
>> On 07/05/2012 08:51 PM, Sasha Levin wrote:
>>> On Thu, 2012-07-05 at 18:29 +0800, Jason Wang wrote:
>>>> @@ -1387,6 +1404,10 @@ static int virtnet_probe(struct virtio_device *vdev)
>>>>           if (virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ))
>>>>                   vi->has_cvq = true;
>>>>
>>>> +       /* Use single tx/rx queue pair as default */
>>>> +       vi->num_queue_pairs = 1;
>>>> +       vi->total_queue_pairs = num_queue_pairs;
>>> The code is using this "default" even if the amount of queue pairs it
>>> wants was specified during initialization. This basically limits any
>>> device to use 1 pair when starting up.
>>>
>> Yes, currently the virtio-net driver would use 1 txq/txq by default
>> since multiqueue may not outperform in all kinds of workload. So it's
>> better to keep it as default and let user enable multiqueue by ethtool -L.
>>
> I would prefer that the driver sized number of queues based on number
> of online CPU's. That is what real hardware does. What kind of workload
> are you doing? If it is some DBMS benchmark then maybe the issue is that
> some CPU's need to be reserved.

I run rr and stream test of netperf, and multiqueue shows improvement on 
rr test and regression on small packet transmission in stream test. For 
small packet transmission, multiqueue tends to send much more small 
packets which also increase the cpu utilization. I suspect multiqueue is 
faster and tcp does not merger big enough packet to send, but may need 
more think.

WARNING: multiple messages have this Message-ID (diff)
From: Jason Wang <jasowang@redhat.com>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: krkumar2@in.ibm.com, habanero@linux.vnet.ibm.com,
	kvm@vger.kernel.org, mst@redhat.com, netdev@vger.kernel.org,
	mashirle@us.ibm.com, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, edumazet@google.com,
	Sasha Levin <levinsasha928@gmail.com>,
	jwhan@filewood.snu.ac.kr, sri@us.ibm.com, davem@davemloft.net,
	tahm@linux.vnet.ibm.com
Subject: Re: [net-next RFC V5 5/5] virtio_net: support negotiating the number of queues through ctrl vq
Date: Fri, 06 Jul 2012 17:26:45 +0800	[thread overview]
Message-ID: <4FF6AF55.9080908@redhat.com> (raw)
In-Reply-To: <20120705233816.3ec0b827@nehalam.linuxnetplumber.net>

On 07/06/2012 02:38 PM, Stephen Hemminger wrote:
> On Fri, 06 Jul 2012 11:20:06 +0800
> Jason Wang<jasowang@redhat.com>  wrote:
>
>> On 07/05/2012 08:51 PM, Sasha Levin wrote:
>>> On Thu, 2012-07-05 at 18:29 +0800, Jason Wang wrote:
>>>> @@ -1387,6 +1404,10 @@ static int virtnet_probe(struct virtio_device *vdev)
>>>>           if (virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ))
>>>>                   vi->has_cvq = true;
>>>>
>>>> +       /* Use single tx/rx queue pair as default */
>>>> +       vi->num_queue_pairs = 1;
>>>> +       vi->total_queue_pairs = num_queue_pairs;
>>> The code is using this "default" even if the amount of queue pairs it
>>> wants was specified during initialization. This basically limits any
>>> device to use 1 pair when starting up.
>>>
>> Yes, currently the virtio-net driver would use 1 txq/txq by default
>> since multiqueue may not outperform in all kinds of workload. So it's
>> better to keep it as default and let user enable multiqueue by ethtool -L.
>>
> I would prefer that the driver sized number of queues based on number
> of online CPU's. That is what real hardware does. What kind of workload
> are you doing? If it is some DBMS benchmark then maybe the issue is that
> some CPU's need to be reserved.

I run rr and stream test of netperf, and multiqueue shows improvement on 
rr test and regression on small packet transmission in stream test. For 
small packet transmission, multiqueue tends to send much more small 
packets which also increase the cpu utilization. I suspect multiqueue is 
faster and tcp does not merger big enough packet to send, but may need 
more think.

  reply	other threads:[~2012-07-06  9:24 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-05 10:29 [net-next RFC V5 0/5] Multiqueue virtio-net Jason Wang
2012-07-05 10:29 ` Jason Wang
2012-07-05 10:29 ` [net-next RFC V5 1/5] virtio_net: Introduce VIRTIO_NET_F_MULTIQUEUE Jason Wang
2012-07-05 10:29   ` Jason Wang
2012-07-05 10:29 ` [net-next RFC V5 2/5] virtio_ring: move queue_index to vring_virtqueue Jason Wang
2012-07-05 10:29   ` Jason Wang
2012-07-05 11:40   ` Sasha Levin
2012-07-05 11:40     ` Sasha Levin
2012-07-06  3:17     ` Jason Wang
2012-07-06  3:17       ` Jason Wang
2012-07-26  8:20     ` Paolo Bonzini
2012-07-26  8:20       ` Paolo Bonzini
2012-07-30  3:30       ` Jason Wang
2012-07-30  3:30         ` Jason Wang
2012-07-05 10:29 ` [net-next RFC V5 3/5] virtio: intorduce an API to set affinity for a virtqueue Jason Wang
2012-07-05 10:29   ` Jason Wang
2012-07-27 14:38   ` Paolo Bonzini
2012-07-27 14:38     ` Paolo Bonzini
2012-07-29 20:40     ` Michael S. Tsirkin
2012-07-29 20:40       ` Michael S. Tsirkin
2012-07-30  6:27       ` Paolo Bonzini
2012-08-09 15:14         ` Paolo Bonzini
2012-08-09 15:14           ` Paolo Bonzini
2012-08-09 15:13   ` Paolo Bonzini
2012-08-09 15:13     ` Paolo Bonzini
2012-08-09 15:35     ` Avi Kivity
2012-08-09 15:35       ` Avi Kivity
2012-07-05 10:29 ` [net-next RFC V5 4/5] virtio_net: multiqueue support Jason Wang
2012-07-05 10:29   ` Jason Wang
2012-07-05 20:02   ` Amos Kong
2012-07-05 20:02     ` Amos Kong
2012-07-06  7:45     ` Jason Wang
2012-07-06  7:45       ` Jason Wang
2012-07-20 13:40   ` Michael S. Tsirkin
2012-07-20 13:40     ` Michael S. Tsirkin
2012-07-21 12:02     ` Sasha Levin
2012-07-21 12:02       ` Sasha Levin
2012-07-23  5:54       ` Jason Wang
2012-07-23  5:54         ` Jason Wang
2012-07-23  9:28         ` Sasha Levin
2012-07-23  9:28           ` Sasha Levin
2012-07-30  3:29           ` Jason Wang
2012-07-30  3:29             ` Jason Wang
2012-07-29  9:44       ` Michael S. Tsirkin
2012-07-29  9:44         ` Michael S. Tsirkin
2012-07-30  3:26         ` Jason Wang
2012-07-30  3:26           ` Jason Wang
2012-07-30 13:00         ` Sasha Levin
2012-07-30 13:00           ` Sasha Levin
2012-07-23  5:48     ` Jason Wang
2012-07-23  5:48       ` Jason Wang
2012-07-29  9:50       ` Michael S. Tsirkin
2012-07-29  9:50         ` Michael S. Tsirkin
2012-07-30  5:15         ` Jason Wang
2012-07-30  5:15           ` Jason Wang
2012-07-05 10:29 ` [net-next RFC V5 5/5] virtio_net: support negotiating the number of queues through ctrl vq Jason Wang
2012-07-05 10:29   ` Jason Wang
2012-07-05 12:51   ` Sasha Levin
2012-07-05 12:51     ` Sasha Levin
2012-07-05 20:07     ` Amos Kong
2012-07-05 20:07       ` Amos Kong
2012-07-06  7:46       ` Jason Wang
2012-07-06  7:46         ` Jason Wang
2012-07-06  3:20     ` Jason Wang
2012-07-06  3:20       ` Jason Wang
2012-07-06  6:38       ` Stephen Hemminger
2012-07-06  6:38         ` Stephen Hemminger
2012-07-06  9:26         ` Jason Wang [this message]
2012-07-06  9:26           ` Jason Wang
2012-07-06  8:10       ` Sasha Levin
2012-07-06  8:10         ` Sasha Levin
2012-07-09 20:13   ` Ben Hutchings
2012-07-09 20:13     ` Ben Hutchings
2012-07-20 12:33   ` Michael S. Tsirkin
2012-07-20 12:33     ` Michael S. Tsirkin
2012-07-23  5:32     ` Jason Wang
2012-07-23  5:32       ` Jason Wang
2012-07-05 17:45 ` [net-next RFC V5 0/5] Multiqueue virtio-net Rick Jones
2012-07-05 17:45   ` Rick Jones
2012-07-06  7:42   ` Jason Wang
2012-07-06  7:42     ` Jason Wang
2012-07-06 16:23     ` Rick Jones
2012-07-06 16:23       ` Rick Jones
2012-07-09  3:23       ` Jason Wang
2012-07-09  3:23         ` Jason Wang
2012-07-09 16:46         ` Rick Jones
2012-07-09 16:46           ` Rick Jones
2012-07-08  8:19 ` Ronen Hod
2012-07-08  8:19   ` Ronen Hod
2012-07-09  5:35   ` Jason Wang
2012-07-09  5:35     ` Jason Wang

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=4FF6AF55.9080908@redhat.com \
    --to=jasowang@redhat.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=habanero@linux.vnet.ibm.com \
    --cc=jwhan@filewood.snu.ac.kr \
    --cc=krkumar2@in.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=levinsasha928@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mashirle@us.ibm.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    --cc=sri@us.ibm.com \
    --cc=tahm@linux.vnet.ibm.com \
    --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 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.