public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Cc: virtualization@lists.linux-foundation.org, kvm@vger.kernel.org,
	axboe@kernel.dk, linux-kernel@vger.kernel.org, hch@infradead.org
Subject: Re: [RFC] virtio: Support releasing lock during kick
Date: Sun, 19 Jun 2011 10:48:41 +0300	[thread overview]
Message-ID: <20110619074841.GA8613@redhat.com> (raw)
In-Reply-To: <1277328242-10685-1-git-send-email-stefanha@linux.vnet.ibm.com>

On Wed, Jun 23, 2010 at 10:24:02PM +0100, Stefan Hajnoczi wrote:
> The virtio block device holds a lock during I/O request processing.
> Kicking the virtqueue while the lock is held results in long lock hold
> times and increases contention for the lock.

As you point out the problem with dropping
and getting this lock in the request function is
that we double the number of atomics here.

How about we teach the block core to call a separate
function with spinlock not held? This way we don't need
to do extra lock/unlock operations, and kick can be
done with lock not held and interrupts enabled.


diff --git a/block/blk-core.c b/block/blk-core.c
index 4ce953f..a8672ec 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -433,6 +433,8 @@ void blk_run_queue(struct request_queue *q)
 	spin_lock_irqsave(q->queue_lock, flags);
 	__blk_run_queue(q);
 	spin_unlock_irqrestore(q->queue_lock, flags);
+	if (q->request_done)
+		q->request_done(q);
 }
 EXPORT_SYMBOL(blk_run_queue);
 

-- 
MST

  parent reply	other threads:[~2011-06-19  7:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-23 21:24 [RFC] virtio: Support releasing lock during kick Stefan Hajnoczi
2010-06-23 22:12 ` Anthony Liguori
2010-06-24  5:30   ` Stefan Hajnoczi
2010-06-25  3:09     ` Rusty Russell
2010-06-25  6:17       ` Stefan Hajnoczi
2010-06-25 10:43       ` Michael S. Tsirkin
2010-06-25 15:31         ` Stefan Hajnoczi
2010-06-25 15:32           ` Michael S. Tsirkin
2010-06-25 16:05             ` Stefan Hajnoczi
2010-06-28 15:55 ` Marcelo Tosatti
2010-06-29  7:08   ` Stefan Hajnoczi
2010-06-29  7:12     ` Avi Kivity
2011-06-19  7:14 ` Michael S. Tsirkin
2011-06-20 15:27   ` Stefan Hajnoczi
2011-06-24  9:16     ` Stefan Hajnoczi
2011-08-10 13:18     ` Christoph Hellwig
2011-08-10 14:39       ` Stefan Hajnoczi
2011-06-19  7:48 ` Michael S. Tsirkin [this message]
2011-06-19 13:55   ` Christoph Hellwig

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=20110619074841.GA8613@redhat.com \
    --to=mst@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=hch@infradead.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefanha@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox