From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72A6A432BD3 for ; Mon, 20 Jul 2026 15:05:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784559944; cv=none; b=GMajfASVEmcv00+bEZsX11dBch8BWCWC7UVWn6bRWmxtG+FHD1zWc+anQ66yq5FftmZbqx8Drw7ztTKpbgn7n2gj5jrpuu22/9z4otoeLg9ty6lUDdWLmdnYTnrMn1kOueDrNmxa2RLSSgYL4Bwel7b5L2Q7LqpR5G7Hti+vXEo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784559944; c=relaxed/simple; bh=7g7fviUMdaUO9vtVwN3GrGUl+UAVgsqZdDOW7caqtbo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iJwbcNw9L5rOf3BS+CkzV10DSnuYBK3UdsRoMzdARzIk7Sbkj29+5PiwAZ8Si5FUR1f+jdDgqC85ISzTT4cVQZxE0pQ5ev0Gz9DiYDfuOzVPdYNySysKr3OqzgXbreVLvjnLS3iu+FvCtO78I8TWAdFunowADjgFN2d0/CRq/MU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 8911968C4E; Mon, 20 Jul 2026 17:05:39 +0200 (CEST) Date: Mon, 20 Jul 2026 17:05:39 +0200 From: Christoph Hellwig To: Keith Busch Cc: Jun Zeng , axboe@kernel.dk, hch@lst.de, sagi@grimberg.me, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, andriy.shevchenko@intel.com, gang.cao@intel.com, jun.i.jin@intel.com, yong.hu@intel.com, Liang Fang , Thomas Gleixner Subject: Re: [PATCH v1 1/1] nvme-pci: adaptive interrupt coalescing Message-ID: <20260720150539.GB17986@lst.de> References: <20260715075703.15578-1-jun1.zeng@intel.com> <20260715075703.15578-2-jun1.zeng@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) 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.