On 11/24/21 5:52 AM, Pankaj Raghav wrote: > Hi Jens, > > On Tue, Nov 23, 2021 at 12:15:18PM -0700, Jens Axboe wrote: >> +bool blk_stats_alloc_enable(struct request_queue *q) >> +{ >> + struct blk_rq_stat *poll_stat; >> + >> + poll_stat = kcalloc(BLK_MQ_POLL_STATS_BKTS, sizeof(*poll_stat), >> + GFP_ATOMIC); >> + if (!poll_stat) >> + return false; >> + >> + if (cmpxchg(&q->poll_stat, poll_stat, NULL) != poll_stat) { > Isn't the logic inverted here? As we already check for non-NULL > q->poll_stat at the caller side, shouldn't it be: > > if (cmpxchg(&q->poll_stat, NULL, poll_stat) != NULL) { Yes, I did fix that one up right after sending this out, here's the patch: https://git.kernel.dk/cgit/linux-block/commit/?h=for-5.17/block&id=987567fece249eabb14406e4e52f427e679d8461 -- Jens Axboe