From: Ammar Faizi <[email protected]>
To: Niklas Cassel <[email protected]>
Cc: Jens Axboe <[email protected]>,
fio Mailing List <[email protected]>,
GNU/Weeb Mailing List <[email protected]>
Subject: Re: [PATCH v2 3/6] stat: Handle `ENOMEM` case in `__show_run_stats()`
Date: Wed, 27 Apr 2022 16:52:19 +0700 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <YmkORZJIxvBOxHJN@x1-carbon>
On 4/27/22 4:35 PM, Niklas Cassel wrote:
> Hello Ammar,
>
> here you allocate runstats with calloc.
>
>> + if (!runstats) {
>> + log_err("fio: failed to allocate runstats\n");
>> + return;
>> + }
>>
>> for (i = 0; i < groupid + 1; i++)
>> init_group_run_stat(&runstats[i]);
>
> Here you call init_group_run_stat() on each runstats,
> which calls memset(). Seems a bit excessive to clear
> the memory to zero twice.
Agreed, I will CC you in the next versions.
Also, it seems like the vger kernel is messed up. My cover letter
and patch #5 don't appear on the lore.
> If you intend to modify init_group_run_stat(), be careful,
> as it is also called by client.c
Let's use `malloc()` for runstats instead of modifying
init_group_run_stat(), which is way much more simpler.
Will spin v3. Thank you!
--
Ammar Faizi
next prev parent reply other threads:[~2022-04-27 9:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-27 9:11 [PATCH v2 0/6] Small fio cleanups and fixes Ammar Faizi
2022-04-27 9:11 ` [PATCH v2 1/6] backend: Fix indentation Ammar Faizi
2022-04-27 9:11 ` [PATCH v2 2/6] cgroup: Handle `ENOMEM` case on `malloc()` call Ammar Faizi
2022-04-27 9:11 ` [PATCH v2 3/6] stat: Handle `ENOMEM` case in `__show_run_stats()` Ammar Faizi
2022-04-27 9:35 ` Niklas Cassel
2022-04-27 9:52 ` Ammar Faizi [this message]
2022-04-27 9:11 ` [PATCH v2 4/6] engines/net: Replace `malloc()` + `memset()` with `calloc()` Ammar Faizi
2022-04-27 9:11 ` [PATCH v2 5/6] json: Change `if (!strlen(str))` to `if (!str[0])` Ammar Faizi
2022-04-27 9:11 ` [PATCH v2 6/6] Makefile: Suppress `-Wimplicit-fallthrough` when compiling `lex.yy` Ammar Faizi
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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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