Re: [PATCH v7 4/9] nvme-multipath: add support for latency I/O policy

Nilay Shroff <[email protected]>
Newsgroups org.infradead.lists.linux-nvme
Message-ID <[email protected]>
On 8/10/26 1:42 PM, John Garry wrote:
> On 09/08/2026 11:07, Nilay Shroff wrote:
>> +    /*
>> +     * If latency > ~1s then ignore this sample to prevent EWMA from being
>> +     * skewed by pathological outliers (multi-second waits, controller
>> +     * timeouts etc.). This keeps path scores representative of normal
>> +     * performance and avoids instability from rare spikes. If such high
>> +     * latency is real, ANA state reporting or keep-alive error counters
>> +     * will mark the path unhealthy and remove it from the head node list,
>> +     * so we safely skip such sample here.
>> +     */
>> +    if (unlikely(latency > NSEC_PER_SEC)) {
>> +        stat->nr_ignored++;
>> +        dev_warn_ratelimited(ns->ctrl->device,
>> +            "ignoring sample with >1s latency (possible controller stall or timeout)\n");
>> +        return;
>> +    }
> 
> JFYI, I gave this series a spin and I see this warn a lot:
> 
> # ./fio_read.sh nvme1n1
> iops: (g=0): rw=read, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T)
> 4096B-4096B, ioengine=libaio, iodepth=100
> ...
> fio-3.38
> Starting 10 processes
> [  130.005374] nvme_mpath_add_sample: 29 callbacks suppressed03h:08m:36s]
> [  130.005387] nvme nvme2: ignoring sample with >1s latency (possible
> controller stall or timeout)
> [  130.009968] nvme nvme2: ignoring sample with >1s latency (possible
> controller stall or timeout)
> [  130.013176] nvme nvme2: ignoring sample with >1s latency (possible
> controller stall or timeout)
> [  130.019576] nvme nvme2: ignoring sample with >1s latency (possible
> controller stall or timeout)
> [  130.022275] nvme nvme2: ignoring sample with >1s latency (possible
> controller stall or timeout)
> [  130.024762] nvme nvme2: ignoring sample with >1s latency (possible
> controller stall or timeout)
> [  130.027268] nvme nvme2: ignoring sample with >1s latency (possible
> controller stall or timeout)
> [  130.130140] nvme nvme2: ignoring sample with >1s latency (possible
> controller stall or timeout)
> [  130.132316] nvme nvme2: ignoring sample with >1s latency (possible
> controller stall or timeout)
> [  130.139279] nvme nvme2: ignoring sample with >1s latency (possible
> controller stall or timeout)
> ^Cbs: 10 (f=10): [R(10)][0.4%][r=35.8MiB/s][r=9171 IOPS][eta 03h:07m:44s]
> fio: terminating on signal 2
> 
> iops: (groupid=0, jobs=10): err= 0: pid=821: Mon Aug 10 08:08:28 2026
>     read: IOPS=9239, BW=36.1MiB/s (37.8MB/s)(1434MiB/39744msec)
>       slat (usec): min=25, max=110836, avg=129.22, stdev=537.18
> 
> Note that I do have many heavy kernel debug options enabled, like kasan and kmemleak, which may influence this.
> 

Thanks for testing. Given that you're running with KASAN, kmemleak, and other
heavy debug options enabled, I think this is expected. Those configurations
can significantly increase I/O completion latency, causing some samples to
exceed the 1-second threshold. The warning is also rate-limited to avoid
flooding the log. That said, still if it's causing a lot of noise in the logs
then we could change it to dev_dbg_ratelimited() from dev_warn_ratelimited().

Thanks,
--Nilay
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.