[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] linux-aio: add IO_CMD_FDSYNC command support
From: |
Prasad Pandit |
Subject: |
Re: [PATCH] linux-aio: add IO_CMD_FDSYNC command support |
Date: |
Fri, 8 Mar 2024 17:38:04 +0530 |
Hello Kevin,
On Fri, 8 Mar 2024 at 14:35, Kevin Wolf <kwolf@redhat.com> wrote:
> Hm... This might make it more challenging because then not only one
> specific request fails, but the whole submission batch.
* Yes exactly.
* I've updated yesterday's patch to return an error (-EINVAL) from
ioq_submit to laio_co_submit and fallback on thread-pool as you said.
It seems to be working fine when the kernel supports an AIO_FDSYNC
call. I'm trying to test it against the Fedora-26 kernel, which was <
4.13.0, and did not support the AIO_FDSYNC call.
> Do we know if it can include unrelated requests?
* Unrelated requests?
> It passes the return value to the request:
>
> if (ret < 0) {
> /* Fail the first request, retry the rest */
> aiocb = QSIMPLEQ_FIRST(&s->io_q.pending);
> QSIMPLEQ_REMOVE_HEAD(&s->io_q.pending, next);
> s->io_q.in_queue--;
> aiocb->ret = ret;
> qemu_laio_process_completion(aiocb);
> continue;
> }
>
> laio_co_submit() then fetches it from laiocb.ret and returns it to its
> caller (in this case, your new code).
* I did not get what's happening here. It looks like when 'io_submit'
returns an error, ioq_submit plucks out the first 'laiocb' object from
QSIMPLEQ and sets the error code (-EINVAL) in it, and continues to
submit further requests in the batch. But what if 'io_submit' of those
further requests also returns an error? ie. For each error code the
first object in the queue is removed and error code is saved in it?
But in laio_co_submit() it is only looking at the 'ret' value of one
local laiocb object, not all in the batch. So which return code 'ret'
is it really checking against -EINPROGRESS?
* If a user submits DEFAULT_MAX_BATCH 32=aio requests, in
laio_co_submit() there does not seem to be a way to see 'io_submit'
return value for all of them, right? Should it check the io_submit
status of them all?
Thank you.
---
- Prasad