diff mbox

[10/15] linux-aio: increase max event to 256

Message ID 1406720388-18671-11-git-send-email-ming.lei@canonical.com
State New
Headers show

Commit Message

Ming Lei July 30, 2014, 11:39 a.m. UTC
This patch increases max event to 256 for the comming
virtio-blk multi virtqueue support.

Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
 block/linux-aio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Eric Blake July 30, 2014, 12:15 p.m. UTC | #1
On 07/30/2014 05:39 AM, Ming Lei wrote:
> This patch increases max event to 256 for the comming

s/comming/coming/

> virtio-blk multi virtqueue support.
> 
> Signed-off-by: Ming Lei <ming.lei@canonical.com>
> ---
>  block/linux-aio.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/linux-aio.c b/block/linux-aio.c
> index 5eb9c92..c06a57d 100644
> --- a/block/linux-aio.c
> +++ b/block/linux-aio.c
> @@ -23,7 +23,7 @@
>   *      than this we will get EAGAIN from io_submit which is communicated to
>   *      the guest as an I/O error.
>   */
> -#define MAX_EVENTS 128
> +#define MAX_EVENTS 256
>  
>  #define MAX_QUEUED_IO  128
>  
>
Paolo Bonzini July 30, 2014, 2 p.m. UTC | #2
Il 30/07/2014 13:39, Ming Lei ha scritto:
> This patch increases max event to 256 for the comming
> virtio-blk multi virtqueue support.
> 
> Signed-off-by: Ming Lei <ming.lei@canonical.com>
> ---
>  block/linux-aio.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

What makes the new magic number less magic than the old one?

Paolo
Ming Lei July 30, 2014, 5:20 p.m. UTC | #3
On Wed, Jul 30, 2014 at 10:00 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> Il 30/07/2014 13:39, Ming Lei ha scritto:
>> This patch increases max event to 256 for the comming
>> virtio-blk multi virtqueue support.
>>
>> Signed-off-by: Ming Lei <ming.lei@canonical.com>
>> ---
>>  block/linux-aio.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> What makes the new magic number less magic than the old one?

Just for supporting the coming multi virtqueue, otherwise it is
easy to trigger EAGAIN.

Or do you have better idea to figure out a non-magic number?

Thanks
Stefan Hajnoczi Aug. 4, 2014, 10:26 a.m. UTC | #4
On Thu, Jul 31, 2014 at 01:20:22AM +0800, Ming Lei wrote:
> On Wed, Jul 30, 2014 at 10:00 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> > Il 30/07/2014 13:39, Ming Lei ha scritto:
> >> This patch increases max event to 256 for the comming
> >> virtio-blk multi virtqueue support.
> >>
> >> Signed-off-by: Ming Lei <ming.lei@canonical.com>
> >> ---
> >>  block/linux-aio.c |    2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > What makes the new magic number less magic than the old one?
> 
> Just for supporting the coming multi virtqueue, otherwise it is
> easy to trigger EAGAIN.
> 
> Or do you have better idea to figure out a non-magic number?

The virtio-blk device knows how many requests can be in-flight at a
time.  laio_init() could take a size parameter.  The messy thing is that
the block layer is between the virtio-blk device and Linux AIO, so we'd
need to pass that information down.

Stefan
diff mbox

Patch

diff --git a/block/linux-aio.c b/block/linux-aio.c
index 5eb9c92..c06a57d 100644
--- a/block/linux-aio.c
+++ b/block/linux-aio.c
@@ -23,7 +23,7 @@ 
  *      than this we will get EAGAIN from io_submit which is communicated to
  *      the guest as an I/O error.
  */
-#define MAX_EVENTS 128
+#define MAX_EVENTS 256
 
 #define MAX_QUEUED_IO  128