From: Michael Tokarev <mjt@tls.msk.ru>
To: Jeff Moyer <jmoyer@redhat.com>
Cc: linux-aio@kvack.org, Linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: aio: compat_ioctl issue?
Date: Tue, 09 Mar 2010 00:50:26 +0300 [thread overview]
Message-ID: <4B957122.4060007@msgid.tls.msk.ru> (raw)
In-Reply-To: <x497hpm8p69.fsf@segfault.boston.devel.redhat.com>
Jeff Moyer wrote:
> Michael Tokarev <mjt@tls.msk.ru> writes:
>
>> Hello.
>>
>> I just come across a situation (next in a long row :)
>> when on x86, 32bit userspace does not work with 64bit
>> kernel. This time this is about aio requests.
>>
>> An application submits some aio job, and it is returned
>> immediately (from io_getevents()) with EINVAL error.
[]
> Can you post the program, please?
The program which I'm trying is quite big - it's qemu-kvm
v. 0.12.3 compiled with --enable-linux-aio. I bugged
kvm folks about non-working aio support but immediately
realized it's 32/64bit issue in the kernel, since 64bit
kvm works just fine on the same kernel (which is 64bits).
So I added 2 printfs into its linux-aio.c and re-run it.
The diff against upstream qemu-kvm is this one:
---- cut -----
diff --git a/linux-aio.c b/linux-aio.c
index 5e892b0..e856873 100644
--- a/linux-aio.c
+++ b/linux-aio.c
@@ -60,6 +60,9 @@ static void qemu_laio_process_completion(struct qemu_laio_state *s,
ret = laiocb->ret;
if (ret != -ECANCELED) {
+if (ret != laiocb->nbytes)
+fprintf(stderr, "io_getevents: exp %d got %d %s\n", laiocb->nbytes, ret,
+strerror(ret));
if (ret == laiocb->nbytes)
ret = 0;
else if (ret >= 0)
@@ -223,6 +226,12 @@ BlockDriverAIOCB *laio_submit(BlockDriverState *bs, void *aio_ctx, int fd,
io_set_eventfd(&laiocb->iocb, s->efd);
s->count++;
+{ struct iovec *v = (struct iovec*)iocbs->u.c.buf;
+printf("io_submit: lio_opcode=%d reqprio=%d iov=%p{%p,%d}, niov=%lu, offset=%Ld\n",
+iocbs->aio_lio_opcode, iocbs->aio_reqprio, iocbs->u.c.buf,
+v->iov_base, v->iov_len,
+iocbs->u.c.nbytes, iocbs->u.c.offset);
+}
if (io_submit(s->ctx, 1, &iocbs) < 0)
goto out_dec_count;
return &laiocb->common;
---- cut -----
I'm not sure if it's useful or not.
Qemu-kvm git tree is at
git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git
I never dealt with aio before, so I'll need to familiarize
myself with it before trying to create a smaller testcase.
Thanks!
/mjt
next prev parent reply other threads:[~2010-03-08 21:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-08 21:38 aio: compat_ioctl issue? Michael Tokarev
2010-03-08 21:43 ` Jeff Moyer
2010-03-08 21:50 ` Michael Tokarev [this message]
2010-03-08 22:25 ` Jeff Moyer
2010-03-08 22:32 ` Michael Tokarev
2010-03-08 22:41 ` Michael Tokarev
2010-03-11 16:06 ` Jeff Moyer
2010-03-11 19:10 ` Michael Tokarev
2010-03-11 19:13 ` Jeff Moyer
2010-03-11 19:46 ` Michael Tokarev
2010-03-11 19:57 ` Jeff Moyer
2010-03-11 20:13 ` Michael Tokarev
2010-03-16 18:52 ` Jeff Moyer
2010-03-16 20:36 ` Michael Tokarev
2010-03-16 20:44 ` Jeff Moyer
2010-04-28 18:00 ` Avi Kivity
2010-04-28 18:11 ` Jeff Moyer
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=4B957122.4060007@msgid.tls.msk.ru \
--to=mjt@tls.msk.ru \
--cc=jmoyer@redhat.com \
--cc=linux-aio@kvack.org \
--cc=linux-kernel@vger.kernel.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.