[RFC PATCH 0/3] nvme-pci: dynamic interrupt moderation

Fengnan changfengnan at bytedance.com
Wed Nov 18 19:31:50 PST 2026


在 02/11/26 20:22, Fengnan 写道:

Hi Keith:

Any comments?

> 
> 
> 在 29/10/26 10:14, changfengnan 写道:
>>
>>> From: "Keith Busch"<kbusch at kernel.org>
>>> Date:  Wed, Oct 28, 2026, 23:15
>>> Subject:  Re: [RFC PATCH 0/3] nvme-pci: dynamic interrupt moderation
>>> To: "Christoph Hellwig"<hch at lst.de>
>>> Cc: "Fengnan"<changfengnan at bytedance.com>, "Keith Busch"<kbusch at meta.com>, <linux-nvme at lists.infradead.org>, <linux-pci at vger.kernel.org>, <tglx at kernel.org>, <namjain at linux.microsoft.com>
>>> On Wed, Oct 28, 2026 at 04:07:12PM +0100, Christoph Hellwig wrote:
>>>> On Thu, Oct 22, 2026 at 05:43:54PM +0800, Fengnan wrote:
>>>>> Hi Keith:
>>>>>  
>>>>> I made some modifications to DIM and then implemented a solution
>>>>> using the DIM framework. 
>>>>> Based on current testing, the results are now comparable to those of
>>>>> the previous patch.
>>>>> Here are the preliminary test results:
>>>>> https://docs.google.com/spreadsheets/d/1e8LQPnaDhmv50XlAM3XxI0TMQkhbk0bTZwlJP1Hzzdk/edit?gid=188992110#gid=188992110
>>>>>  
>>>>> If you agree with this approach, I’ll continue testing and optimizing.
>>>>  
>>>> І can't speak for Keith, but I'd really love to see this going forward!
>>>  
>>> Same! This is a great problem to solve, but I'm just sorry I don't have
>>> more cycles to work on the cause. I can quickly respin the msix noflush
>>> pre-patches to address the naming issues tglx mentioned, and we can take
>>> nvme in whichever direction has the best performance.
>>>  
>>
>> That sounds good.
>> I'm currently working on continuously optimizing and testing both
>> approaches (using DIM and not using DIM). 
>> I plan to update the code and add new data again next Monday.
>>
>> Thanks.
> 
> 
> Hi Keith and Christoph,
> 
> I've prepared two implementations of adaptive IRQ polling: one reusing
> the DIM tuning state machine and one using an NVMe-specific policy.
> 
> I tested both with a 158-case fio matrix and additional latency and
> CPU-contention tests. The results show broadly similar throughput gains
> over their respective OFF baselines in the tested workloads.
> 
> Test data:
> [1] Non-DIM version:
> https://docs.google.com/spreadsheets/d/17kmXH9Zkr2jrN-19BwaInSx53HwOdRPJFrZ-Hjlk0_Y/edit?gid=300100#gid=300100
> 
> [2] DIM version:
> https://docs.google.com/spreadsheets/d/18JADnBXWAGkffY_3LsPJ6ftA9DGH6qpNbKvP-lQWLnE/edit?gid=300200#gid=300200
> 
> Both implementations are opt-in and choose between IRQ completion and
> timer-driven polling per I/O queue. They evaluate samples of at least
> 32,768 completions and use a target polling interval of 10 us. A polling
> trial must improve the completion rate by more than 1%. Once successful,
> polling can continue while its rate stays within roughly 1% of the saved
> IRQ baseline, subject to a completion-progress guard.
> 
> Neither implementation uses I/O latency as a tuning metric.
> 
> The non-DIM implementation uses explicit rules inside the NVMe driver.
> It admits polling trials at an IRQ completion rate of about 100k
> completions/s per queue and applies a fixed completion-count backoff
> after three consecutive failures.
> 
> The DIM implementation uses IRQ and POLL as two profiles. It explores
> polling without that fixed admission threshold and requires a trial
> to gain more than both 1% and one completion/ms. While parked on IRQ,
> it increases the wait between trials from 1 to 2, 4, 8 and then 16 valid
> IRQ samples. It also discards stale samples and stops the polling timer
> when the queue drains.
> 
> During development, I felt that the version with `dim` required more
> rules to achieve a similar effect. So, I still prefer the version
> without `dim` because it’s simpler, easier to understand, and easier
> to maintain.
> 
> Which approach would you prefer?
> 
> 
> All the patches are in the attachment.



More information about the Linux-nvme mailing list