Explain to me like I'm dumb: I/O Polling and Hybrid Polling

I am stumped at this to find if there’s any advantage to turning this on for my NVMe drives. I’m currently running the Level1 recommended SK Hynix Gold P31 500GB drive and it’s one of the best PCI-E Gen 3 drives out there for the price.

I don’t know if enabling polling would help performance. I’m aware of the CPU usage cost, but there’s also that hybrid polling brought up in this paper:

Is there any advantage to shifting from the default?

Currently:

cat /sys/block/nvme0n1/queue/io_poll
0
cat /sys/block/nvme0n1/queue/io_poll_delay
-1

on my Ubuntu 20.04 LTS install on my i9-10920X.

Would I just echo into sysfs to turn it on? Do i have to do it everytime at boot?

I’m not sure where the usual place to set those are, but it’s going to be volatile.

The real answer is to test it out. Balance the gains in latency with any downside in CPU overhead.

The short answer is no.

The medium length answer is.
You have a few cores with the i9 and a reasonably fast drive. So you probably aren’t going to see much downside, but… you aren’t likely to see that much of an upside. With a desktop system, I doubt it would help with anything you’d notice, the paper you include talks about shaving 2us off the command. Which is a significant portion of the write latency to really good NAND drive, but only if you’re not writing enough to overflow it’s write buffer. But it’s a negligible amount for a NAND drive read operation or write when you’re really pushing it.

Maybe if you’re doing databases or something else with heavy random IO, then you can get up to 10%, but even then I doubt it. For most desktop situations, the filesystem overhead will render the gains un-noticeable. But you know test it, maybe my data is out of date.

Okay, so it’s like a placebo pill for desktop systems.

The most intense I/O isn’t really random in AVX-512 based video encoding in FFmpeg. So I shouldn’t need to worry about that setting then unless I have an Optane.

1 Like

Yes. I think that a fair way to frame it.

It’s the sort of optimization that is really important if the biggest bottleneck you have is IO latency. Which happens. And 5% gain on your biggest bottleneck is worth money some places.