[opensuse-kernel] Linux 4.12 & BFQ
Hello. Is BFQ enabled for kernel builds? I tried elevator=bfq with 4.12.rc7 and got all partitions unmountable. -- Best regards, Dmitriy Perlow -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
On Tue, 04 Jul 2017 22:28:23 +0200, Dmitriy A. Perlow wrote:
Hello.
Is BFQ enabled for kernel builds? I tried elevator=bfq with 4.12.rc7 and got all partitions unmountable.
On 4.12, BFQ is available as multi-queue I/O scheduler, so it's a two step enablement: - Pass scsi.use_blk_mq=1 boot option to switch to SCSI MQ. - Choose bfq in /sys/block/sd*/queue/scheduler file, e.g. # echo bfq > /sys/block/sda/queue/scheduler The latter can be automated via udev, tmpfiles.d or whatever, too. HTH, Takashi -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
06.07.2017 16:41, Takashi Iwai пишет:
On Tue, 04 Jul 2017 22:28:23 +0200, Dmitriy A. Perlow wrote:
Hello.
Is BFQ enabled for kernel builds? I tried elevator=bfq with 4.12.rc7 and got all partitions unmountable.
On 4.12, BFQ is available as multi-queue I/O scheduler, so it's a two step enablement:
- Pass scsi.use_blk_mq=1 boot option to switch to SCSI MQ.
- Choose bfq in /sys/block/sd*/queue/scheduler file, e.g. # echo bfq > /sys/block/sda/queue/scheduler
The latter can be automated via udev, tmpfiles.d or whatever, too.
Can it be set as global default for all devices? -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
Thu, 06 Jul 2017 20:24:37 +0300 Andrei Borzenkov
06.07.2017 16:41, Takashi Iwai пишет:
On Tue, 04 Jul 2017 22:28:23 +0200, Dmitriy A. Perlow wrote:
Is BFQ enabled for kernel builds? I tried elevator=bfq with 4.12.rc7 and got all partitions unmountable.
On 4.12, BFQ is available as multi-queue I/O scheduler, so it's a two step enablement:
- Pass scsi.use_blk_mq=1 boot option to switch to SCSI MQ.
scsi_mod.use_blk_mq=1 Thanks. It works ok ;)
- Choose bfq in /sys/block/sd*/queue/scheduler file, e.g. # echo bfq > /sys/block/sda/queue/scheduler
The latter can be automated via udev, tmpfiles.d or whatever, too.
Can it be set as global default for all devices?
/etc/udev/rules.d/60-sched.rules : #set bfq scheduler for non-rotating disks ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="bfq" # set bfq scheduler for rotating disks ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq" -- Best regards, Dmitriy Perlow -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
On Thu, 06 Jul 2017, 19:24:37 +0200, Andrei Borzenkov wrote:
06.07.2017 16:41, Takashi Iwai пишет:
On Tue, 04 Jul 2017 22:28:23 +0200, Dmitriy A. Perlow wrote:
Hello.
Is BFQ enabled for kernel builds? I tried elevator=bfq with 4.12.rc7 and got all partitions unmountable.
On 4.12, BFQ is available as multi-queue I/O scheduler, so it's a two step enablement:
- Pass scsi.use_blk_mq=1 boot option to switch to SCSI MQ.
- Choose bfq in /sys/block/sd*/queue/scheduler file, e.g. # echo bfq > /sys/block/sda/queue/scheduler
The latter can be automated via udev, tmpfiles.d or whatever, too.
Can it be set as global default for all devices?
Sure, just add the following to your bootloader's command line: scsi.use_blk_mq=1 elevator=bfq The "elevator=..." thing remains the same as it used to work for quite some time now. HTH, cheers. l8er manfred
Thu, 06 Jul 2017 20:39:31 +0300 Manfred Hollstein
On Thu, 06 Jul 2017, 19:24:37 +0200, Andrei Borzenkov wrote:
06.07.2017 16:41, Takashi Iwai пишет:
On Tue, 04 Jul 2017 22:28:23 +0200, Dmitriy A. Perlow wrote:
Hello.
Is BFQ enabled for kernel builds? I tried elevator=bfq with 4.12.rc7 and got all partitions unmountable.
On 4.12, BFQ is available as multi-queue I/O scheduler, so it's a two step enablement:
- Pass scsi.use_blk_mq=1 boot option to switch to SCSI MQ.
- Choose bfq in /sys/block/sd*/queue/scheduler file, e.g. # echo bfq > /sys/block/sda/queue/scheduler
The latter can be automated via udev, tmpfiles.d or whatever, too.
Can it be set as global default for all devices?
Sure, just add the following to your bootloader's command line:
scsi.use_blk_mq=1 elevator=bfq
elevator=bfq seems not to work for some reason…
The "elevator=..." thing remains the same as it used to work for quite some time now.
HTH, cheers.
l8er manfred
-- Best regards, Dmitriy Perlow -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
06.07.2017 20:37, Dmitriy A. Perlow пишет:
- Choose bfq in /sys/block/sd*/queue/scheduler file, e.g. # echo bfq > /sys/block/sda/queue/scheduler
The latter can be automated via udev, tmpfiles.d or whatever, too.
Can it be set as global default for all devices?
I know how to write udev rules, thank you :) You can chose default old-school scheduler via kernel parameter.
/etc/udev/rules.d/60-sched.rules :
#set bfq scheduler for non-rotating disks ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0",
"26 disks ought to be enough for anybody ..." :) -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
On Thu, 06 Jul 2017, 19:41:08 +0200, Dmitriy A. Perlow wrote:
Thu, 06 Jul 2017 20:39:31 +0300 Manfred Hollstein
напісаў(ла): On Thu, 06 Jul 2017, 19:24:37 +0200, Andrei Borzenkov wrote:
06.07.2017 16:41, Takashi Iwai пишет:
On Tue, 04 Jul 2017 22:28:23 +0200, Dmitriy A. Perlow wrote:
Hello.
Is BFQ enabled for kernel builds? I tried elevator=bfq with 4.12.rc7 and got all partitions unmountable.
On 4.12, BFQ is available as multi-queue I/O scheduler, so it's a two step enablement:
- Pass scsi.use_blk_mq=1 boot option to switch to SCSI MQ.
- Choose bfq in /sys/block/sd*/queue/scheduler file, e.g. # echo bfq > /sys/block/sda/queue/scheduler
The latter can be automated via udev, tmpfiles.d or whatever, too.
Can it be set as global default for all devices?
Sure, just add the following to your bootloader's command line:
scsi.use_blk_mq=1 elevator=bfq
elevator=bfq seems not to work for some reason…
Yeah, IIRC it might have to be "mq-bfq"; will test immediately and report back.
The "elevator=..." thing remains the same as it used to work for quite some time now.
Cheers. l8er manfred
On Thu, 06 Jul 2017, 19:53:43 +0200, Manfred Hollstein wrote:
On Thu, 06 Jul 2017, 19:41:08 +0200, Dmitriy A. Perlow wrote:
[...] elevator=bfq seems not to work for some reason…
Yeah, IIRC it might have to be "mq-bfq"; will test immediately and report back.
The "elevator=..." thing remains the same as it used to work for quite some time now.
Indeed, something strange is going on here: # cat /proc/cmdline BOOT_IMAGE=/vmlinuz-4.12.0-2.g7c5c393-default root=... quiet scsi.use_blk_mq=1 # cat /sys/block/sd?/queue/*scheduler* noop [deadline] cfq noop [deadline] cfq noop [deadline] cfq BUT: # dmesg | grep scheduler [ 2.059289] io scheduler noop registered [ 2.059289] io scheduler deadline registered [ 2.059296] io scheduler cfq registered (default) [ 2.059296] io scheduler mq-deadline registered [ 2.059297] io scheduler kyber registered [ 2.059303] io scheduler bfq registered So, it should be "bfq", but it does not seem to be available?!? Strange... Cheers. l8er manfred
Thu, 06 Jul 2017 21:03:56 +0300 Manfred Hollstein
On Thu, 06 Jul 2017, 19:53:43 +0200, Manfred Hollstein wrote:
On Thu, 06 Jul 2017, 19:41:08 +0200, Dmitriy A. Perlow wrote:
[...] elevator=bfq seems not to work for some reason…
Yeah, IIRC it might have to be "mq-bfq"; will test immediately and report back.
The "elevator=..." thing remains the same as it used to work for quite some time now.
Indeed, something strange is going on here:
# cat /proc/cmdline BOOT_IMAGE=/vmlinuz-4.12.0-2.g7c5c393-default root=... quiet scsi.use_blk_mq=1
Please note: scsi_mod.use_blk_mq=1
# cat /sys/block/sd?/queue/*scheduler* noop [deadline] cfq noop [deadline] cfq noop [deadline] cfq
BUT:
# dmesg | grep scheduler [ 2.059289] io scheduler noop registered [ 2.059289] io scheduler deadline registered [ 2.059296] io scheduler cfq registered (default) [ 2.059296] io scheduler mq-deadline registered [ 2.059297] io scheduler kyber registered [ 2.059303] io scheduler bfq registered
So, it should be "bfq", but it does not seem to be available?!?
Strange...
Cheers.
l8er manfred
-- Best regards, Dmitriy Perlow -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
On Thu, 06 Jul 2017, 20:20:57 +0200, Dmitriy A. Perlow wrote:
Thu, 06 Jul 2017 21:03:56 +0300 Manfred Hollstein
напісаў(ла): On Thu, 06 Jul 2017, 19:53:43 +0200, Manfred Hollstein wrote:
On Thu, 06 Jul 2017, 19:41:08 +0200, Dmitriy A. Perlow wrote:
[...] elevator=bfq seems not to work for some reason…
Yeah, IIRC it might have to be "mq-bfq"; will test immediately and report back.
The "elevator=..." thing remains the same as it used to work for quite some time now.
Indeed, something strange is going on here:
# cat /proc/cmdline BOOT_IMAGE=/vmlinuz-4.12.0-2.g7c5c393-default root=... quiet scsi.use_blk_mq=1
Please note: scsi_mod.use_blk_mq=1
Hmm, of course, you are right. I now have the following: # cat /proc/cmdline BOOT_IMAGE=/vmlinuz-4.12.0-2.g7c5c393-default root=... quiet scsi_mod.use_blk_mq=1 # cat /sys/block/sd?/queue/scheduler [mq-deadline] kyber bfq none [mq-deadline] kyber bfq none [mq-deadline] kyber bfq none And, switching the scheduler at runtime works now: # echo bfq > /sys/block/sdb/queue/scheduler # echo bfq > /sys/block/sdc/queue/scheduler # cat /sys/block/sd?/queue/scheduler [mq-deadline] kyber bfq none mq-deadline kyber [bfq] none mq-deadline kyber [bfq] none So, using the _right_ ;) parameter to select the mq scheduler should work. Does it work for you now, too? Cheers. l8er manfred
Thu, 06 Jul 2017 21:41:48 +0300 Manfred Hollstein
On Thu, 06 Jul 2017, 20:20:57 +0200, Dmitriy A. Perlow wrote:
Thu, 06 Jul 2017 21:03:56 +0300 Manfred Hollstein
напісаў(ла): On Thu, 06 Jul 2017, 19:53:43 +0200, Manfred Hollstein wrote:
On Thu, 06 Jul 2017, 19:41:08 +0200, Dmitriy A. Perlow wrote:
[...] elevator=bfq seems not to work for some reason…
Yeah, IIRC it might have to be "mq-bfq"; will test immediately and report back.
The "elevator=..." thing remains the same as it used to work for quite some time now.
Indeed, something strange is going on here:
# cat /proc/cmdline BOOT_IMAGE=/vmlinuz-4.12.0-2.g7c5c393-default root=... quiet scsi.use_blk_mq=1
Please note: scsi_mod.use_blk_mq=1
Hmm, of course, you are right. I now have the following:
# cat /proc/cmdline BOOT_IMAGE=/vmlinuz-4.12.0-2.g7c5c393-default root=... quiet scsi_mod.use_blk_mq=1 # cat /sys/block/sd?/queue/scheduler [mq-deadline] kyber bfq none [mq-deadline] kyber bfq none [mq-deadline] kyber bfq none
And, switching the scheduler at runtime works now:
# echo bfq > /sys/block/sdb/queue/scheduler # echo bfq > /sys/block/sdc/queue/scheduler # cat /sys/block/sd?/queue/scheduler [mq-deadline] kyber bfq none mq-deadline kyber [bfq] none mq-deadline kyber [bfq] none
So, using the _right_ ;) parameter to select the mq scheduler should work. Does it work for you now, too?
bfq works ok if switched at runtime or via udev rule but not via elevator kernel option.
Cheers.
l8er manfred
-- Best regards, Dmitriy Perlow -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
On Thu, Jul 06, 2017 at 09:56:48PM +0300, Dmitriy A. Perlow wrote:
bfq works ok if switched at runtime or via udev rule but not via elevator kernel option.
This is correct, see below: /* * Use the default elevator specified by config boot param for * non-mq devices, or by config option. Don't try to load modules * as we could be running off async and request_module() isn't * allowed from async. */ if (!e && !q->mq_ops && *chosen_elevator) { e = elevator_get(chosen_elevator, false); if (!e) printk(KERN_ERR "I/O scheduler %s not found\n", chosen_elevator); } if (!e) { /* * For blk-mq devices, we default to using mq-deadline, * if available, for single queue devices. If deadline * isn't available OR we have multiple queues, default * to "none". */ if (q->mq_ops) { if (q->nr_hw_queues == 1) e = elevator_get("mq-deadline", false); if (!e) return 0; } else e = elevator_get(CONFIG_DEFAULT_IOSCHED, false); CONFIG_DEFAULT_IOSCHED for MQ was rejected by Linus himself [1] Can you please open a bugzilla entry for it so we can track it? I can't promise I get this upstream in the v4.13 cycle though, as this is not only a code but a bit of a political issue. [1]: https://lkml.org/lkml/2017/2/21/791 Thanks, Johannes -- Johannes Thumshirn Storage jthumshirn@suse.de +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850 -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
Thank you!
https://bugzilla.opensuse.org/show_bug.cgi?id=1047993
Fri, 07 Jul 2017 10:33:52 +0300 Johannes Thumshirn
On Thu, Jul 06, 2017 at 09:56:48PM +0300, Dmitriy A. Perlow wrote:
bfq works ok if switched at runtime or via udev rule but not via elevator kernel option.
This is correct, see below:
/* * Use the default elevator specified by config boot param for * non-mq devices, or by config option. Don't try to load modules * as we could be running off async and request_module() isn't * allowed from async. */ if (!e && !q->mq_ops && *chosen_elevator) { e = elevator_get(chosen_elevator, false); if (!e) printk(KERN_ERR "I/O scheduler %s not found\n", chosen_elevator); } if (!e) { /* * For blk-mq devices, we default to using mq-deadline, * if available, for single queue devices. If deadline * isn't available OR we have multiple queues, default * to "none". */ if (q->mq_ops) { if (q->nr_hw_queues == 1) e = elevator_get("mq-deadline", false); if (!e) return 0; } else e = elevator_get(CONFIG_DEFAULT_IOSCHED, false);
CONFIG_DEFAULT_IOSCHED for MQ was rejected by Linus himself [1]
Can you please open a bugzilla entry for it so we can track it? I can't promise I get this upstream in the v4.13 cycle though, as this is not only a code but a bit of a political issue.
[1]: https://lkml.org/lkml/2017/2/21/791
Thanks, Johannes
-- Best regards, Dmitriy Perlow -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
participants (5)
-
Andrei Borzenkov
-
Dmitriy A. Perlow
-
Johannes Thumshirn
-
Manfred Hollstein
-
Takashi Iwai