On 11/23/21 11:50 AM, Christoph Hellwig wrote: >> + spin_lock_irq(&q->stats->lock); >> + if (q->poll_stat) { >> + spin_unlock_irq(&q->stats->lock); >> + kfree(poll_stat); >> + return true; >> + } >> + q->poll_stat = poll_stat; >> + spin_unlock_irq(&q->stats->lock); > > If we'd use a cmpxchg to install the pointer we could keep the > blk_queue_stats definition private. How about we just move this alloc+enable logic into blk-stat.c instead? -- Jens Axboe