On 3/4/21 3:59 PM, Chaitanya Kulkarni wrote: > On 3/4/21 03:01, Kanchan Joshi wrote: >> On Thu, Mar 4, 2021 at 3:14 AM Chaitanya Kulkarni >> <Chaitanya.Kulkarni@xxxxxxx> wrote: >>> On 3/2/21 23:22, Kanchan Joshi wrote: >>>> + if (!ioucmd) >>>> + cptr = &c; >>>> + else { >>>> + /*for async - allocate cmd dynamically */ >>>> + cptr = kmalloc(sizeof(struct nvme_command), GFP_KERNEL); >>>> + if (!cptr) >>>> + return -ENOMEM; >>>> + } >>>> + >>>> + memset(cptr, 0, sizeof(c)); >>> Why not kzalloc and remove memset() ? >> Yes sure. Ideally I want to get rid of the allocation cost. Perhaps >> employing kmem_cache/mempool can help. Do you think there is a better >> way? >> > > Is this hot path ? It's command issue, and for a bypass (kind of) solution. It's most definitely the hot path. -- Jens Axboe