Re: [PATCH v1 1/1] nvme-pci: adaptive interrupt coalescing

From: Christoph Hellwig

Date: Mon Jul 20 2026 - 11:53:07 EST


On Thu, Jul 16, 2026 at 02:52:41PM -0600, Keith Busch wrote:
> On Wed, Jul 15, 2026 at 03:57:03PM +0800, Jun Zeng wrote:
> > Add adaptive interrupt coalescing to improve IOPS for high-throughput
> > workloads. Monitor IO pressure periodically and enable/disable coalescing
> > automatically based on IOPS, queue depth, and inflight IO thresholds.
> > This feature is enabled by default, can be controlled through debugfs
> > variable during runtime.
>
> Can't you do all this from user space? You'd maybe need the blk-mq
> debugfs to get access to the individual hctx dispatch numbers, but maybe
> that's okay?

Having these kinds of interfaces where we rely on a userspace daemon
to be in sync with the kernel implementation are a mess, and really
lock us out of future improvements in this area.

> The atomic_long_inc where you placed it is especially harmful to polled
> queues.

We really should be able to do this without any counters, as blk-mq keeps
more than enough statistics. And of course for polled queues nothing
related to interrupt coalescing is actually need.

And we should take a page from the networking playbook and look into
adaptively switching to polling under high load instead of just
mitigating interrupts. An important part of that is to move the CQ
reaping from irq context to thread context.

But modulo all these caveats adaptive interrupt coalescing /
moderation is something we absolute need right now and even more so
going foward.

Note that a few month ago there also was as an interesting patchset
that does global interrupt moderation at the IRQ controller level.
I don't remember what happened to it and can't find a link to it,
but adding the interrupt maintainer in case he remembers.