How to enable the BFQ I/O scheduler on kernel >=4.12

bfq
scheduler
linux

(kepszlok) #26

Only the grub.cfg’s manual editing worked. Strange…

Btw now i got the new schedulers, i will be back after some testing with the phoronix test suite. The other 3 are already tested.

The results are here. https://pastebin.com/M8dcnABT

I did x264, x264-opencl, ffmpeg, 7zip, lzma and unigine benchmarks with all six schedulers. There are extremly small differences between them, and there are no clear winner.

edit:
I run the tests on SSD, with 8-core FX-8320 running at 4GHz, with 16GB ram and an RX460 4GB vga.


(tom) #27

with your system you will never feel the scheduler working i suppose.
a bit about what the scheduler does https://www.youtube.com/watch?v=F5Ri_HhziI0

you can feel the schedulers work if you don’t feel latency while a (back round) process does heavy I/O


(kepszlok) #28

Then i may also run some test on my much weeker laptop.


(tom) #29

a litte about benchmarking tools https://wiki.archlinux.org/index.php/Benchmarking#interbench

more about BFQ http://algogroup.unimore.it/people/paolo/disk_sched/


(dinolib) #30

Hi, following first post instructions, I didn’t find bfq as default scheduler:

sudo cat /sys/block/sda/queue/scheduler [mq-deadline] kyber bfq none

Is this a problem?

EDIT: sorry, I found that bfq is only for SSD. And the SDD is using bfq.
mq-deadline is fine fo HDDs?


(tom) #31

“mq” stands for “multi queue” and it isn’t a good idea to use multi queue with a HDD because thy can handle only one queue.
you can use the deadline scheduler on HDD if you want but you shouldn’t use multi queue because it will sacrifice performance


(dinolib) #32

I’m confused: mq-deadline is only available:

sudo cat /sys/block/sda/queue/scheduler
[mq-deadline] kyber bfq none


(tom) #33

why are you confused?^^
you have done a change on your kernel command line, right? and you have added “scsi_mod.use_blk_mq=1”, correct? then read the initial post from this thread again because there is the explanation why :slight_smile:


(dinolib) #34

I’m just wondering: I have SSD and HDD. bfq if for SSD but mq-deadline is not optimal for HDDs… So what should I use?
(note that at the moment with bfq and mq-deadline there are no performance issues, but I should try some heavy I/O app)


(tom) #35

i suppose one is sda and the sdb, right?

cat /sys/block/sda/queue/scheduler

cat /sys/block/sdb/queue/scheduler

for scheduler testing you can try interbench https://aur.archlinux.org/packages/interbench/


(dinolib) #37

Every disk (sda/b/c/d/e) here has all the same schedulers list:
mq-deadline kyber bfq none

SDD uses bfq
HDDs use mq-deadline

As stated in the first post, whenever I changed the kernel parameter, cfq is no more available.
So, if mq-deadline is not fine for HDDs, which one is better to be used?

EDIT: the comments in the suggested udev rules are also misleading (for me): it speaks of cfq. Is it right? I can’t understand why we need three lines, and I can’t understand first line code"TEST!=“queue/rotational”.

Here I found the opposite suggestion than ours:

mq-dealine for SSD
bfq for HDD

Now my confusion is complete…

(I found some Phoronix benchmark also, but it is intended mainly for server uses, I think. Anyway the multiqueue is almost never best in performance.)


(tom) #38

the manjaro kernel is patched with the “old” bfq for HDD you can’t compare with our not patched kernel

this is a bad thing


(Luca Giambonini) #39

true, but then if I remove “scsi_mod.use_blk_mq=1” I would have only:
noop deadline [cfq]

So, if I have an hybrid system (sda1=SSD and sdb=HDD) how I can set bfq for sda and cfq for sdb?
Even more, the initial 60-scheduler.rules is not correct, because deadline and cfq are not available when scsi_mod.use_blk_mq is set! do you agree?

This comment is interesting:
https://bugs.archlinux.org/task/55061#comment160030


(tom) #40

scsi_mod.use_blk_mq=1 is the switch between multi queue scheduler and “normal” scheduler.

i don’t know and i have no idea to to this …see dinolib above


(Skool182) #41

Hi,

I’ve tried to enable BFQ on my laptop (with m.2 SATA SSD) and I got a lot of freezes, when starting chromium for example.
I disabled it and all is fine again.
I looked on logs after a freeze, but the freese is too quick to write logs, so, there is nothing to see…
My laptop is a Dell Latitude E7450.
I’m using cfq again and it’s working great.


(Alexander Waldemar Ahjolinna) #42

the 4.12 kernel had for some reason A LOT of problems with bfq, most (if not all) of the major bugs should have been resolved already, so it would be nice if chakra would soon update to the latest 4.12(.10)…or even 4.13 that just arrived, which has way more bfq fixes (and “features”) …thankfully after the huge 4.12 release the 4.13 was surprisingly small one…I think it’s mostly fixing the 4.12 problems (+ some minor features)

(other pkgs in testing could maybe use an update also, as there many who have gotten bugfix releases, which I don’t get why they should be ignored…not like there is a coherent schedule that chakraOS team needs to keep-up with anyways)


(ugjka) #43

hey it worked :slight_smile: gotta love chakra