From: Krishna Kanth Reddy <krish.reddy@samsung.com>
To: Damien Le Moal <Damien.LeMoal@wdc.com>
Cc: "axboe@kernel.dk" <axboe@kernel.dk>,
"fio@vger.kernel.org" <fio@vger.kernel.org>,
Ankit Kumar <ankit.kumar@samsung.com>
Subject: Re: [PATCH 2/4] libaio: support for Zone Append command
Date: Fri, 3 Jul 2020 16:17:48 +0530 [thread overview]
Message-ID: <20200703104748.GD27933@test-zns> (raw)
In-Reply-To: <CY4PR04MB3751B98A411CC5C6B29CA442E7930@CY4PR04MB3751.namprd04.prod.outlook.com>
[-- Attachment #1: Type: text/plain, Size: 2909 bytes --]
On Fri, Jun 26, 2020 at 05:38:53AM +0000, Damien Le Moal wrote:
>On 2020/06/26 2:41, Krishna Kanth Reddy wrote:
>> From: Ankit Kumar <ankit.kumar@samsung.com>
>>
>> The zone append command uses the write path with offset as
>> start of the zone. Upon successful completion, multiple of
>> sectors relative to the zone's start offset, where the data
>> has been placed is returned.
>>
>> Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
>> ---
>> engines/libaio.c | 20 +++++++++++++++++++-
>> 1 file changed, 19 insertions(+), 1 deletion(-)
>>
>> diff --git a/engines/libaio.c b/engines/libaio.c
>> index 398fdf9..4ffe831 100644
>> --- a/engines/libaio.c
>> +++ b/engines/libaio.c
>> @@ -123,7 +123,13 @@ static int fio_libaio_prep(struct thread_data *td, struct io_u *io_u)
>> if (o->nowait)
>> iocb->aio_rw_flags |= RWF_NOWAIT;
>> } else if (io_u->ddir == DDIR_WRITE) {
>> - io_prep_pwrite(iocb, f->fd, io_u->xfer_buf, io_u->xfer_buflen, io_u->offset);
>> + if ((td->o.zone_mode == ZONE_MODE_ZBD) && td->o.zone_append) {
>> + io_prep_pwrite(iocb, f->fd, io_u->xfer_buf, io_u->xfer_buflen, io_u->zone_start_offset);
>> + }
>
>No need for the added braces. And see my comment in the previous patch about
>zone_start_offset. You can calculate it from io_u->offset.
>
Sure, will remove the braces and zone_start_offset. Offset will be
calculated as per your comments.
>> + else
>> + io_prep_pwrite(iocb, f->fd, io_u->xfer_buf, io_u->xfer_buflen, io_u->offset);
>> + if (td->o.zone_append)
>> + iocb->aio_rw_flags |= RWF_ZONE_APPEND;
>> if (o->nowait)
>> iocb->aio_rw_flags |= RWF_NOWAIT;
>> } else if (ddir_sync(io_u->ddir))
>> @@ -228,6 +234,18 @@ static int fio_libaio_getevents(struct thread_data *td, unsigned int min,
>> } else {
>> r = io_getevents(ld->aio_ctx, actual_min,
>> max, ld->aio_events + events, lt);
>> + if (td->o.zone_mode == ZONE_MODE_ZBD) {
>> + struct io_event *ev;
>> + struct io_u *io_u;
>
>Add a blank line after declarations please.
>
Sure.
>> + for (unsigned event = 0; event < r; event++) {
>
>Better declare event above instead of here. I know C allows it, but this looks
>like C++ to me :)
>
Yeah sure :) Will modify this.
>> + ev = ld->aio_events + event;
>> + io_u = container_of(ev->obj, struct io_u, iocb);
>> + if (td->o.zone_append
>> + && td->o.do_verify && td->o.verify
>> + && (io_u->ddir == DDIR_WRITE))
>
>So this is done only if verify is on ? Then why do the loop at all if verify is
>off ? Move the "td->o.zone_append && td->o.do_verify && td->o.verify" condition
>outside the loop.
>
Yes, right. Will move this outside the loop.
>> + io_u->ipo->offset = io_u->zone_start_offset + (ev->res2 << 9);
>
>same here about start offset.
>
Ok, sure.
>> + }
>> + }
>> }
>> if (r > 0)
>> events += r;
>>
>
>
>--
>Damien Le Moal
>Western Digital Research
>
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2020-07-03 10:47 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20200625174119epcas5p122a2197102fe336aa35fdea1273fd1b0@epcas5p1.samsung.com>
2020-06-25 17:38 ` [PATCH 0/4] v2 Patchset : Zone Append command support for NVMe Zoned Namespaces (ZNS) Krishna Kanth Reddy
2020-06-25 17:38 ` [PATCH 1/4] Add " Krishna Kanth Reddy
2020-06-26 5:33 ` Damien Le Moal
2020-07-03 17:17 ` Krishna Kanth Reddy
2020-06-26 5:50 ` Damien Le Moal
2020-07-03 16:50 ` Krishna Kanth Reddy
2020-06-25 17:38 ` [PATCH 2/4] libaio: support for Zone Append command Krishna Kanth Reddy
2020-06-26 5:38 ` Damien Le Moal
2020-07-03 10:47 ` Krishna Kanth Reddy [this message]
2020-06-25 17:38 ` [PATCH 3/4] iouring: " Krishna Kanth Reddy
2020-06-26 5:43 ` Damien Le Moal
2020-07-03 10:37 ` Krishna Kanth Reddy
2020-06-25 17:38 ` [PATCH 4/4] t/zbd: Add support to verify Zone Append command with libaio, io_uring IO engine tests Krishna Kanth Reddy
2020-06-25 18:44 ` Dmitry Fomichev
2020-07-03 8:46 ` Krishna Kanth Reddy
2020-06-26 5:45 ` Damien Le Moal
2020-07-03 9:09 ` Krishna Kanth Reddy
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=20200703104748.GD27933@test-zns \
--to=krish.reddy@samsung.com \
--cc=Damien.LeMoal@wdc.com \
--cc=ankit.kumar@samsung.com \
--cc=axboe@kernel.dk \
--cc=fio@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox