On 10/17/18 8:52 AM, vincentfu@xxxxxxxxx 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