public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Venkatesh Srinivas <venkateshs@google.com>
To: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	linux-scsi@vger.kernel.org,
	virtualization@lists.linux-foundation.org, rusty@rustcorp.com.au,
	mst@redhat.com, asias@redhat.com, JBottomley@parallels.com,
	pbonzini@redhat.com
Subject: Re: [PATCH V6 4/5] virtio-scsi: introduce multiqueue support
Date: Wed, 20 Mar 2013 14:22:48 -0700	[thread overview]
Message-ID: <20130320212247.GA18276@google.com> (raw)
In-Reply-To: <1363762884-11000-5-git-send-email-gaowanlong@cn.fujitsu.com>

On Wed, Mar 20, 2013 at 03:01:23PM +0800, Wanlong Gao wrote:
>From: Paolo Bonzini <pbonzini@redhat.com>
>
>This patch adds queue steering to virtio-scsi.  When a target is sent
>multiple requests, we always drive them to the same queue so that FIFO
>processing order is kept.  However, if a target was idle, we can choose
>a queue arbitrarily.  In this case the queue is chosen according to the
>current VCPU, so the driver expects the number of request queues to be
>equal to the number of VCPUs.  This makes it easy and fast to select
>the queue, and also lets the driver optimize the IRQ affinity for the
>virtqueues (each virtqueue's affinity is set to the CPU that "owns"
>the queue).
>
>The speedup comes from improving cache locality and giving CPU affinity
>to the virtqueues, which is why this scheme was selected.  Assuming that
>the thread that is sending requests to the device is I/O-bound, it is
>likely to be sleeping at the time the ISR is executed, and thus executing
>the ISR on the same processor that sent the requests is cheap.
>
>However, the kernel will not execute the ISR on the "best" processor
>unless you explicitly set the affinity.  This is because in practice
>you will have many such I/O-bound processes and thus many otherwise
>idle processors.  Then the kernel will execute the ISR on a random
>processor, rather than the one that is sending requests to the device.
>
>The alternative to per-CPU virtqueues is per-target virtqueues.  To
>achieve the same locality, we could dynamically choose the virtqueue's
>affinity based on the CPU of the last task that sent a request.  This
>is less appealing because we do not set the affinity directly---we only
>provide a hint to the irqbalanced running in userspace.  Dynamically
>changing the affinity only works if the userspace applies the hint
>fast enough.

Looks good! Tested as V5.

Tested-by: Venkatesh Srinivas <venkateshs@google.com>

-- vs;

  reply	other threads:[~2013-03-20 21:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-20  7:01 [PATCH V6 0/5] virtio-scsi multiqueue Wanlong Gao
2013-03-20  7:01 ` [PATCH V6 1/5] virtio-scsi: redo allocation of target data Wanlong Gao
2013-03-20  7:33   ` Asias He
2013-03-20  7:01 ` [PATCH V6 2/5] virtio-scsi: pass struct virtio_scsi to virtqueue completion function Wanlong Gao
2013-03-20  7:01 ` [PATCH V6 3/5] virtio-scsi: push vq lock/unlock into virtscsi_vq_done Wanlong Gao
2013-03-20  7:01 ` [PATCH V6 4/5] virtio-scsi: introduce multiqueue support Wanlong Gao
2013-03-20 21:22   ` Venkatesh Srinivas [this message]
2013-03-20  7:01 ` [PATCH V6 5/5] virtio-scsi: reset virtqueue affinity when doing cpu hotplug Wanlong Gao
2013-03-20  7:24   ` Asias He
2013-03-20  7:33     ` Wanlong Gao
2013-03-20  7:56     ` Wanlong Gao
2013-03-23  6:36       ` Paolo Bonzini
2013-03-23 11:16         ` Wanlong Gao

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=20130320212247.GA18276@google.com \
    --to=venkateshs@google.com \
    --cc=JBottomley@parallels.com \
    --cc=asias@redhat.com \
    --cc=gaowanlong@cn.fujitsu.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rusty@rustcorp.com.au \
    --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