<div><div dir="auto">Brilliant answer, thanks!</div></div><div dir="auto"><br></div><div dir="auto">I found it particularly interesting to learn that there are default mq schedulers picked by the kernel itself.  My incorrect understanding had been that the kernel would always default to “none” in the mq framework and it was up to distros to provide udev rules.</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 7 Aug 2019 at 15:24, Colin Ian King <<a href="mailto:colin.king@canonical.com">colin.king@canonical.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Paul,<br>
<br>
<br>
> I had a look at the same image as Ian:<br>
> <br>
> 72491db7ef6f3cd4b085b9fe1f232345 *bionic-desktop-amd64.iso<br>
> <br>
> I was mostly curious about single queue devices now defaulting to the<br>
> multi queue IO scheduler framework (previously they used the legacy IO<br>
> schedulers - <a href="https://lwn.net/Articles/767987/" rel="noreferrer" target="_blank">https://lwn.net/Articles/767987/</a> ).  I was also<br>
> interested to see how the udev rules might work to select an<br>
> appropriate multiqueue scheduler for nvme / ssd / hdd.<br>
> <br>
> What I found:<br>
> <br>
> 1. There are no udev rules for different devices, but my ssd and hdd<br>
> defaulted to a sensible multiqueue scheduler anyway (both using<br>
> mq-deadline).<br>
<br>
Multi-queue devices now default to using the multiqueue mq-deadline<br>
scheduler. This is a kernel driven choice based on the device being a<br>
multiqueue device, there are no udev rules in this choice whatsoever.<br>
<br>
> <br>
> 2. With 18.04.2 my SATA disks used the legacy "cfq" scheduler by<br>
> default, and with 18.04.3 they use "mq-deadline" by default.<br>
> <br>
> <br>
> So my quesions are:<br>
> <br>
> 1. Will the transition to a multi-queue IO scheduler default be called<br>
> out in the release notes for 18.04.3?<br>
<br>
Indeed, this needs to be documented.<br>
<br>
<br>
> There are two possible<br>
> surprises for users.  First, as I understand it the spiritual<br>
> successor to "cfq" should be "bfq", not "mq-deadline".  Second, any<br>
> 18.04.2 users who have set grub boot parameters to select which legacy<br>
> IO scheduler to use will find their parameter no longer working as<br>
> they now need to configure multi-queue parameters instead.<br>
<br>
I suspect BFQ will replace CFQ as default as some point in the future,<br>
however, at the time of testing for the HWE kernel being used for<br>
18.04.3 we found a few corner cases where it didn't quite work as we<br>
expected performance-wise, so we chose not to use it for that kernel.<br>
<br>
It's hard to select the perfect default I/O scheduler since we need the<br>
"best" choice for different file systems (ext2/3/4, xfs, btrfs etc) for<br>
SSD, HDDs and NVME devices. The choice made was based on tens of<br>
hundreds of tests covering 25 different synthetic fio tests on various<br>
devices with all the available I/O schedulers (7 for this particular<br>
kernel).  Each I/O scheduler as pros/cons, so there are always going to<br>
be occasions where the default is not perfect for some use-cases.<br>
<br>
> <br>
> 2. Will the Ubuntu "IOSchedulers" wiki page be updated wrt 18.04.3?  (<br>
> <a href="https://wiki.ubuntu.com/Kernel/Reference/IOSchedulers" rel="noreferrer" target="_blank">https://wiki.ubuntu.com/Kernel/Reference/IOSchedulers</a> )  It says<br>
> things like "Prior to Ubuntu 19.10..", which will need updated.  (I<br>
> think this wiki page was already uncorrect, surely it should have said<br>
> "Prior to Ubuntu 19.04" ?)<br>
<br>
Yes, I will get that updated. Thanks for pointing this out.<br>
<br>
> <br>
> 3. Just for my own curiosity, how does Ubuntu 18.04.3 select a default<br>
> mq scheduler without udev rules like other distros do (e.g. Arch -<br>
> <a href="https://wiki.archlinux.org/index.php?title=Improving_performance&oldid=578436#Changing_I/O_scheduler" rel="noreferrer" target="_blank">https://wiki.archlinux.org/index.php?title=Improving_performance&oldid=578436#Changing_I/O_scheduler</a><br>
> ) ?<br>
> <br>
<br>
This is handled in the kernel in block/elevator.c, the specific block<br>
drivers for each device and the various I/O scheduling code in the block<br>
directory. If the device is multi-queue cable then the flags for this<br>
device are set with the BLK_MQ_F_NO_SCHED bit so the multi-queue default<br>
is selected, otherwise we fall back to the non-multi-queue default.<br>
<br>
Hope that clarifies things,<br>
<br>
Colin<br>
</blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Paul Richards</div>