• How to enable BFQ I/O scheduler with kernel 4.12?


    My Antergos always use cfq…
    I installed linux-zen from Arch repo…
    I edited /etc/udev/rules.d/60-schedulers.rules file…
    I added scsi_mod.use_blk_mq=1 parameter to grub config file…

    Nothing worked. Can anyone help me please? Thanks.

  • See here.

    https://wiki.archlinux.org/index.php/Linux-ck#How_to_enable_the_BFQ_I.2FO_Scheduler

    Edit: So, I tested on my system. Here is my 60-schedulers.rules file:

    # set deadline scheduler for non-rotating disks
    ACTION=="add|change", KERNEL=="sd[a-z]", TEST!="queue/rotational", ATTR{queue/scheduler}="deadline"
    ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="bfq"
    
    # set cfq scheduler for rotating disks
    ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="cfq"
    

    This works for me. You installed linux-zen but are you sure you are using it? If I boot into default kernel scheduler drops to cfq.

  • yes, uname -r says
    4.12.3-1-zen

    My system is still using cfq
    cat /sys/block/sd*/queue/scheduler says

    noop deadline [cfq]

  • @Strangiato this is interesting because you dont even have an option to choose bfq. This option should come default by linux-zen as far as I know. I didnt need some extra configuration or packages to have bfq.

    There are couple of things you can try:

    • remove and reinstall linux-zen
    • maybe you need kernel headers so install linux-zen-headers
    • if none of these works you can try linux-ck

    You can post this in arch forums as well since linux-zen is from official repo. Dont tell them you are using Antergos.

  • Same thing after install the linux-zen kernel headers. :angry:

  • Assuming you modified /etc/default/grub, did you regenerate grub.cfg with:

    # grub-mkconfig -o /boot/grub/grub.cfg
    

    and reboot?

  • @triode13 Yes, I rebooted my machine.

    But it’s solved now!

    Edit /etc/udev/rules.d/60-schedulers.rules file
    Comment the line ACTION==“add|change”, KERNEL==“sd[a-z]”, TEST!=“queue/rotational”, ATTR{queue/scheduler}=“deadline”

    Edit the line about rotate disks (I use only HDs) changing to bfq in the end of line:
    ACTION==“add|change”, KERNEL==“sd[a-z]”, ATTR{queue/rotational}==“1”, ATTR{queue/scheduler}=“bfq”

    Create the file /etc/systemd/system/[email protected]
    Add the content below into the file

    [Unit]
    Description=Set BFQ for %i
    
    [Service]
    Type=oneshot
    ExecStart=-/usr/bin/bash -c 'echo bfq >/sys/block/%i/queue/scheduler'
    RemainAfterExit=yes
    
    [Install]
    WantedBy=multi-user.target
    

    Edit /etc/default/grub file and add
    scsi_mod.use_blk_mq=1 parameter to GRUB_CMDLINE_LINUX_DEFAULT line

    Run grub-mkconfig -o /boot/grub/grub.cfg and reboot

    Now cat /sys/block/sd*/queue/scheduler output is
    mq-deadline kyber [bfq] none
    mq-deadline kyber [bfq] none
    mq-deadline kyber [bfq] none

    It worked only with kernel linux-zen.

Posts 7Views 1697
Log in to reply