OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

virtio-dev message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [virtio-dev] A simple example of virtio blk driver

On Wed, Jun 08, 2016 at 05:27:40PM +0530, Srinivas Nayak wrote:
> Long back in 2013 I wrote a driver,
> following Rusty's paper, "Towards a de facto standard..."
> which used to fill only one descriptor chain
> (the header-buffer-status chain for blk device) into available ring.
> And after kick, when I get an IRQ,
> I collect the data and then proceed to fill another such a request.
> It felt sequential.
> I read that, even before a single kick,
> many such chains can be fit into available ring.
> And thus getting the benefit of parallel execution of all requests.
> Which is parallel.
> But I couldn't do it.
> And meanwhile that standard 0.95 was obsolete.
> Now we have 1.0. Not sure how big the difference it brings.
> So wanted to see a driver which takes benefit of parallelism.
> And works with IRQ mechanism.

Yes, virtio-blk supports multiple in-flight requests.  If you submit
multiple requests keep in mind that there is no ordering between then so
don't submit overlapping requests.

> Say, I fill up 4 such requests and fired a single kick.
> Will device interrupt me 4 times with IRQ?

Not necessarily.  IRQs notify the guest that there are items in the used
ring.  If the device completed multiple requests at the same time then
they could be added to the used ring and only 1 IRQ is raised.  The
guest needs to process the used ring fully each time it is notified.

> I hope so...then only the benefit of parallelism comes...right?

Batching completion notifications can help performance but it isn't the
main factor in good disk I/O performance through parallelism.

There are several factors including eliminating think time between
servicing I/O requests, exploiting the disk's hardware parallelism
capabilities, reducing the number of vmexits, allowing the host I/O
scheduler to see more requests, etc.

> But if so, when driver accesses used ring,
> how can device use it to place the next served index?

Please review how vrings work.  One side writes the incremented index to
add items, the other side reads the latest index and processes all items
since the last index update.

> Can there be a chance of IRQ miss?

If the guest ignores IRQs then it may stall (unless it also using
polling to check for vring used ring index changes).


Attachment: signature.asc
Description: PGP signature

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]