Open avikivity opened 6 years ago
I get results that are inconsistent with the spec from testing. To get 1000 reads/sec, I need to set the time byte to 36, which corresponds to units of ~30usec, not 100usec. Doubling to 72 gives me 500 reads/sec.
$ sudo nvme set-feature /dev/nvme0n1 --feature-id 8 --value 0x24aa
set-feature:08 (Interrupt Coalescing), value:0x0024aa
$ sudo nvme set-feature /dev/nvme0n1 --feature-id 8 --value 0x48aa
set-feature:08 (Interrupt Coalescing), value:0x0048aa
On another machine, with an enterprise disk, it works as expected. The value of 10 for coalescing time gives me 1000 reads/sec. So my desktop disk probably implements the spec incorrectly.
Alternative (better) approach is #536, but requires a new kernel.
In these post-meltdown days interrupts are expensive. The default NVMe configuration does not coalesce interrupts, and because NVMe completion rate is typically much faster than task-quota-ms, we'll see an interrupt per completion with no batching.
The following command colaesces up to 10 NVME interrupts for a period of 200 usec:
The lower byte (0x0a) specifies the number of interrupts to coalesce, the upper byte (0x02) the amount of time to coalesc, in units of 100 usec. I verified that it works on my machine:
In the beginning of the run, coalescing was enabled, and towards the end I disabled it (and interrupt rate went up).