From: Jens Axboe <axboe@kernel.dk>
To: vincentfu@gmail.com, fio@vger.kernel.org
Cc: Vincent Fu <vincent.fu@wdc.com>
Subject: Re: [PATCH v2 2/4] fio: enable cross-thread overlap checking with processes
Date: Wed, 17 Oct 2018 09:32:59 -0600 [thread overview]
Message-ID: <f98f3bc3-85dc-151a-1431-7a00eb5da24a@kernel.dk> (raw)
In-Reply-To: <20181017145225.14546-3-vincentfu@gmail.com>
On 10/17/18 8:52 AM, vincentfu@gmail.com wrote:
> -bool io_u_qinit(struct io_u_queue *q, unsigned int nr)
> +bool io_u_qinit(struct io_u_queue *q, unsigned int nr, bool shared)
> {
> - q->io_us = calloc(nr, sizeof(struct io_u *));
> + if (shared) {
> + q->io_us = smalloc(nr * sizeof(struct io_u *));
> + memset(q->io_us, 0, nr * sizeof(struct io_u *));
> + }
> + else
> + q->io_us = calloc(nr, sizeof(struct io_u *));
> +
smalloc() returns zeroed memory.
Apart from that, I think this patch looks fine.
--
Jens Axboe
next prev parent reply other threads:[~2018-10-17 15:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-17 14:52 [PATCH v2 0/4] cross-job overlap patches vincentfu
2018-10-17 14:52 ` [PATCH v2 1/4] fio: add function to check for serialize_overlap with offload submission vincentfu
2018-10-17 15:33 ` Sébastien Boisvert
2018-10-17 14:52 ` [PATCH v2 2/4] fio: enable cross-thread overlap checking with processes vincentfu
2018-10-17 15:32 ` Jens Axboe [this message]
2018-10-17 14:52 ` [PATCH v2 3/4] fio: document locking for overlap checking in offload mode vincentfu
2018-10-17 14:52 ` [PATCH v2 4/4] docs: serialize_overlap=1 with io_submit_mode=offload no longer requires threads vincentfu
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=f98f3bc3-85dc-151a-1431-7a00eb5da24a@kernel.dk \
--to=axboe@kernel.dk \
--cc=fio@vger.kernel.org \
--cc=vincent.fu@wdc.com \
--cc=vincentfu@gmail.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