LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Arch (https://www.linuxquestions.org/questions/arch-29/)
-   -   multiple drives io-scheduler use (https://www.linuxquestions.org/questions/arch-29/multiple-drives-io-scheduler-use-4175610882/)

WFV 07-29-2017 08:55 PM

multiple drives io-scheduler use
 
I'm a little confused regarding setting up different schedulers for different drives (SSD and HDD) in the Wiki for using BFQ. The example using udev, in order to make the HDD's use BFQ, do I just add a second line to the rule and edit it for rotational = 1 and the desired scheduler, or can the one line be appended with an "else" statement, or does it require a separate rule (e.g. 61-ioscheduler.rule)? I successfully set BFQ to spin drive sda in a VirtualBox guest Arch using the udev example and grub edit, but host is Arch with multiple drives:
sda = SSD ext4
sdb = HDD ext4
sdc = HDD ext4
sdd = HDD ext4
sde = HDD ntfs
I plan to use noop or deadline for the SSD and BFQ for the HDDs. Thanks anyone.
EDIT (current schedulers in use):
Code:

% cat /sys/block/sd*/queue/scheduler
[noop] deadline cfq
noop deadline [cfq]
noop deadline [cfq]
noop deadline [cfq]
noop deadline [cfq]

and available schedulers:
Code:

% zgrep IOSCHED /proc/config.gz
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y
CONFIG_CFQ_GROUP_IOSCHED=y
CONFIG_DEFAULT_IOSCHED="cfq"
CONFIG_MQ_IOSCHED_DEADLINE=y
CONFIG_MQ_IOSCHED_KYBER=y
CONFIG_IOSCHED_BFQ=y
CONFIG_BFQ_GROUP_IOSCHED=y


WFV 07-30-2017 12:54 AM

this works for now, forgetting using other schedulers (deleted the tmpfiles.d conf file I was using to set the SSD to noop with stock kernel elevator=cfq), changed /etc/default/grub per the wiki for blk_mq, and created the udev rule:
Code:

/etc/udev/rules.d/60-schedulers.rules
# set deadline scheduler for non-rotating disks
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline"

# set bfq scheduler for rotating disks
ACTION=="add|change", KERNEL=="sd[b-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq"

results:
Code:

# for f in /sys/block/sd?/queue/scheduler; do printf "$f is "; cat $f; done
/sys/block/sda/queue/scheduler is [mq-deadline] kyber bfq none
/sys/block/sdb/queue/scheduler is mq-deadline kyber [bfq] none
/sys/block/sdc/queue/scheduler is mq-deadline kyber [bfq] none
/sys/block/sdd/queue/scheduler is mq-deadline kyber [bfq] none
/sys/block/sde/queue/scheduler is mq-deadline kyber [bfq] none
/sys/block/sdf/queue/scheduler is mq-deadline kyber [bfq] none

had to add that second line to the rule as it seems to ignore the rotational ATTRibute and initially had set all drives to deadline.

WFV 08-12-2017 12:08 PM

The boot journal still shows io scheduler default as cfq.
Code:

% journalctl -b | grep scheduler
Aug 11 19:15:31 arch-pelago kernel: io scheduler noop registered
Aug 11 19:15:31 arch-pelago kernel: io scheduler deadline registered
Aug 11 19:15:31 arch-pelago kernel: io scheduler cfq registered (default)
Aug 11 19:15:31 arch-pelago kernel: io scheduler mq-deadline registered
Aug 11 19:15:31 arch-pelago kernel: io scheduler kyber registered
Aug 11 19:15:31 arch-pelago kernel: io scheduler bfq registered

Why is this?

Grub is set to
Code:

GRUB_CMDLINE_LINUX_DEFAULT="quiet radeon.dpm=1 scsi_mod.use_blk_mq=y dm_mod.use_blk_mq=y"
and clearly it works as shown in the previous post having rebuilt grub, created the udev rule, and rerun mkinitcpio, and the other schedulers are no longer an elevator option cfq, noop, deadline as expected.

EDIT: so I since switched back to the stock deadline for ssd, and cfq for spin drives due to system was becoming sluggish (thunar, google-chrome (internet in general)) or intermittent noticeable lags. I used bfq in the past with Graysky's linux-ck-piledriver optimized kernel with excellent results until it switched to MuQSS which for some reason wouldn't work with cgroups on my build and I couldn't figure out how to make it.


All times are GMT -5. The time now is 08:41 AM.