On Wed, Sep 23, 2026 at 5:39 PM Keith Busch <[email protected]> wrote: > > On Wed, Sep 23, 2026 at 03:20:02PM +0300, Markku Ahvenjärvi wrote: > > cq_pending counts interrupt-enabled completion queues with unconsumed > > entries. nvme_cq_notifier() and nvme_process_db() decrement it whenever > > a CQ becomes empty, but they may also process a notification or doorbell > > write for a CQ that was already empty. > > Is there a host actually doing this? If the host writes a doorbell > register to an empty queue, that is a spec violation on the host and the > controller should fail the queue. If it's not the admin queue, then the > controller should to send the Invalid Doorbell Write Value AEN > completion.
No, the host is (probably) doing the right thing. nvme_post_cqes() also updates the CQ head, so it can run before QEMU processes the corresponding doorbell. I observed this with ioeventfd=on, where MMIO doorbell handling is asynchronous, which makes the already empty CQ case more likely.
