On Fri, Mar 08, 2019 at 09:31:02PM -0700, Jens Axboe wrote:
> On 3/8/19 2:59 PM, Keith Busch wrote:
> > Make depth options command line parameters so a recompile isn't
> > required to see how it affects performance.
>
> Thanks, everything really should be command line options. But I never
> bothered, it wasn't mean to live this long :-)
It's a nice convenient way to do some quick and light benchmarking,
so we've been finding it very useful.
But I totally rushed this patch and just sent it once I heard it "worked",
and it really doesn't because malloc doesn't zero the buffer. My mistake,
kzalloc spoiled me. Here's the fix:
---
diff --git a/t/io_uring.c b/t/io_uring.c
index 36aede9b..363cba3e 100644
--- a/t/io_uring.c
+++ b/t/io_uring.c
@@ -526,7 +526,8 @@ int main(int argc, char *argv[])
}
}
- submitter = malloc(sizeof(*submitter) * depth * sizeof(struct iovec));
+ submitter = malloc(sizeof(*submitter) + depth * sizeof(struct iovec));
+ memset(submitter, 0, sizeof(*submitter) + depth * sizeof(struct iovec));
s = submitter;
flags = O_RDONLY | O_NOATIME;
--