From: Anton Nefedov <anton.nefedov@virtuozzo.com>
To: Max Reitz <mreitz@redhat.com>,
"qemu-block@nongnu.org" <qemu-block@nongnu.org>
Cc: "kwolf@redhat.com" <kwolf@redhat.com>,
Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
"berto@igalia.com" <berto@igalia.com>,
Denis Lunev <den@virtuozzo.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"jsnow@redhat.com" <jsnow@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v8 4/9] ide: account UNMAP (TRIM) operations
Date: Wed, 21 Aug 2019 11:06:02 +0000 [thread overview]
Message-ID: <ad8b4780-c385-27bf-d087-9a840df1e5de@virtuozzo.com> (raw)
In-Reply-To: <b992ab09-af44-1be7-aab3-18ff1267f853@redhat.com>
On 12/8/2019 9:16 PM, Max Reitz wrote:
> On 16.05.19 16:33, Anton Nefedov wrote:
>> Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com>
>> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>> ---
>> hw/ide/core.c | 12 ++++++++++++
>> 1 file changed, 12 insertions(+)
>>
>> diff --git a/hw/ide/core.c b/hw/ide/core.c
>> index 6afadf894f..3a7ac93777 100644
>> --- a/hw/ide/core.c
>> +++ b/hw/ide/core.c
>> @@ -441,6 +441,14 @@ static void ide_issue_trim_cb(void *opaque, int ret)
>> TrimAIOCB *iocb = opaque;
>> IDEState *s = iocb->s;
>>
>> + if (iocb->i >= 0) {
>> + if (ret >= 0) {
>> + block_acct_done(blk_get_stats(s->blk), &s->acct);
>> + } else {
>> + block_acct_failed(blk_get_stats(s->blk), &s->acct);
>
> Hmm, in other places (ide_handle_rw_error() here or
> scsi_handle_rw_error() in scsi-disk) only report this with
> BLOCK_ERROR_ACTION_REPORT.
>
> So I’m wondering whether the same should be done here.
>
Many other places do not check the action:
scsi_{dma|read|write}_complete(), hw/ide/atapi.c calls
That feels somewhat weird to me, to account the operation complete when
it's not.
(But I don't really know the use cases of BLOCK_ERROR_ACTION_IGNORE).
Can it be that the error action is only checked so that the operation is
not accounted twice (as there might be block_acct_done() later in the
common path with ACTION_IGNORE)
/Anton
next prev parent reply other threads:[~2019-08-21 11:40 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-16 14:33 [Qemu-devel] [PATCH v8 0/9] discard blockstats Anton Nefedov
2019-05-16 14:33 ` [Qemu-devel] [PATCH v8 1/9] qapi: group BlockDeviceStats fields Anton Nefedov
2019-05-16 14:33 ` [Qemu-devel] [PATCH v8 2/9] qapi: add unmap to BlockDeviceStats Anton Nefedov
2019-05-16 14:33 ` [Qemu-devel] [PATCH v8 3/9] block: add empty account cookie type Anton Nefedov
2019-05-16 15:34 ` Vladimir Sementsov-Ogievskiy
2019-05-16 16:00 ` Anton Nefedov
2019-05-16 14:33 ` [Qemu-devel] [PATCH v8 4/9] ide: account UNMAP (TRIM) operations Anton Nefedov
2019-08-12 18:16 ` Max Reitz
2019-08-21 11:06 ` Anton Nefedov [this message]
2019-05-16 14:33 ` [Qemu-devel] [PATCH v8 5/9] scsi: store unmap offset and nb_sectors in request struct Anton Nefedov
2019-08-12 17:58 ` Max Reitz
2019-08-21 11:03 ` Anton Nefedov
2019-05-16 14:33 ` [Qemu-devel] [PATCH v8 6/9] scsi: move unmap error checking to the complete callback Anton Nefedov
2019-05-16 14:33 ` [Qemu-devel] [PATCH v8 7/9] scsi: account unmap operations Anton Nefedov
2019-05-16 14:33 ` [Qemu-devel] [PATCH v8 8/9] file-posix: account discard operations Anton Nefedov
2019-05-16 15:23 ` Vladimir Sementsov-Ogievskiy
2019-05-16 14:33 ` [Qemu-devel] [PATCH v8 9/9] qapi: query-blockstat: add driver specific file-posix stats Anton Nefedov
2019-08-12 19:04 ` Max Reitz
2019-08-21 11:00 ` Anton Nefedov
2019-08-21 11:21 ` Max Reitz
2019-08-21 12:22 ` Anton Nefedov
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=ad8b4780-c385-27bf-d087-9a840df1e5de@virtuozzo.com \
--to=anton.nefedov@virtuozzo.com \
--cc=berto@igalia.com \
--cc=den@virtuozzo.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.com \
/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;
as well as URLs for NNTP newsgroup(s).