You are not logged in.

#3101 2017-10-16 20:45:49

graysky
Member
From: /usr/share/zoneinfo/US/Eastern
Registered: 2008-12-01
Posts: 9,225
Website

Re: unofficial linux-ck repo with cpu optimized packages is ONLINE

sir_lucjan believes that http://ck.kolivas.org/patches/4.0/4.13/ … ing-.patch is to blame.  I am building and will test the resulting package that is ck1 minus this patch.  If successful, I will push to the AUR.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3102 2017-10-16 20:52:06

loqs
Member
Registered: 2014-03-06
Posts: 2,804

Re: unofficial linux-ck repo with cpu optimized packages is ONLINE

graysky yes http://ck.kolivas.org/patches/4.0/4.13/ … ing-.patch is the 4.13 equivalent of http://ck.kolivas.org/patches/4.0/4.12/ … ing-.patch but there is no 4.13 equivalent of http://ck.kolivas.org/patches/4.0/4.12/ … ed-b.patch
Edit:
not suggesting that you should add a 4.13 equivalent as it will not achieve setting the default scheduler to BFQ without changing the actual kernel code.
Unfortunately despite your communications and mine with CK during the 4.12 cycle he seems to have not examined the changes to block/elevator.c since 4.9 which makes what he is attempting using only config options impossible.

Last edited by loqs (2017-10-16 21:00:19)

Offline

#3103 2017-10-16 21:02:10

graysky
Member
From: /usr/share/zoneinfo/US/Eastern
Registered: 2008-12-01
Posts: 9,225
Website

Re: unofficial linux-ck repo with cpu optimized packages is ONLINE

graysky wrote:

sir_lucjan believes that http://ck.kolivas.org/patches/4.0/4.13/ … ing-.patch is to blame.  I am building and will test the resulting package that is ck1 minus this patch.  If successful, I will push to the AUR.

OK... 4.13.7-2 is up.  Please build and test.  No modifications should be needed.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3104 2017-10-16 21:11:53

loqs
Member
Registered: 2014-03-06
Posts: 2,804

Re: unofficial linux-ck repo with cpu optimized packages is ONLINE

If users want bfq / kyber  will need to added scsi_mod.use_block_mq=1 and a udev rule
@graysky you going to port over how zen does bfq support by default including sq-bfq for default support when scsi_mod.use_block_mq=0?

Offline

#3105 2017-10-16 22:15:24

graysky
Member
From: /usr/share/zoneinfo/US/Eastern
Registered: 2008-12-01
Posts: 9,225
Website

Re: unofficial linux-ck repo with cpu optimized packages is ONLINE

@loqs - can you point me to the relevant code?  I will take a look.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3106 2017-10-16 22:33:09

loqs
Member
Registered: 2014-03-06
Posts: 2,804

Re: unofficial linux-ck repo with cpu optimized packages is ONLINE

https://github.com/zen-kernel/zen-kerne … d5d926bac4
The change that enables bfq by default is effectively one line in block/elevator.c that switches  e = elevator_get("mq-deadline", false); to e = elevator_get("bfq", false); if #if defined(CONFIG_ZEN_INTERACTIVE) && defined(CONFIG_IOSCHED_BFQ)
That would enable bfq by default with a one line change if you enabled CONFIG_SCSI_MQ_DEFAULT in the .config

sq-bfq the bfq for when multiqueue is off also the bfq from before it was merged into mainline is https://github.com/zen-kernel/zen-kerne … -iosched.c

Offline

#3107 2017-10-16 23:37:44

Ropid
Member
Registered: 2015-03-09
Posts: 403

Re: unofficial linux-ck repo with cpu optimized packages is ONLINE

4.13.7-2 seems to work for me.

Offline

#3108 2017-10-18 10:32:10

xsmile
Member
Registered: 2012-03-31
Posts: 29

Re: unofficial linux-ck repo with cpu optimized packages is ONLINE

graysky wrote:

[...] For me, booting with just elevator=cfq is fine.  You too?

If this is still relevant - yes, setting 'elevator=cfq' is enough.

Offline

#3109 2017-10-18 10:49:27

graysky
Member
From: /usr/share/zoneinfo/US/Eastern
Registered: 2008-12-01
Posts: 9,225
Website

Re: unofficial linux-ck repo with cpu optimized packages is ONLINE

I shared the info loqs posted a few above with CK on his blog.  To me, this should be fixed upstream.
http://ck-hack.blogspot.com/2017/10/lin … 0187786632


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3110 2017-10-18 15:38:16

loqs
Member
Registered: 2014-03-06
Posts: 2,804

Re: unofficial linux-ck repo with cpu optimized packages is ONLINE

https://bugzilla.kernel.org/show_bug.cgi?id=196695 I opened this after the issue with 4.12 but the most likely fix will check if there is a mismatch between the queue and elevator on the use of multiqueue and ignore the parameter if there is.
What this would mean for linux-ck is,  attempting to set the elevator to bfq from the .config would not cause an oops but would still fail and CK would still need to change the code in block/elevator.c.
You might want to document on the AUR page or the linux-ck page on the wiki if uses want bfq/kyber they need to follow the same steps as users of the linux package:
$ cat /sys/block/X/queue/scheduler where X is the block device they want to enable bfq/kyber for
If the output does not contain mq-deadline kyber bfq none they need to set the kernel parameter scsi_mod.use_blk_mq=1
Create a udev rule for the device setting the scheduler to bfq/kyber.
As for the upstream bug report there has been no response in two months was hoping CK would push it forward on the linux-block mailing list but he was unwilling.

Offline

#3111 2017-10-21 12:01:43

graysky
Member
From: /usr/share/zoneinfo/US/Eastern
Registered: 2008-12-01
Posts: 9,225
Website

Re: unofficial linux-ck repo with cpu optimized packages is ONLINE

@loqs - If we go with the udev rule solution (commented on the wiki), what is the minimal changes I need to make to the ck package to implement?  I don't have much free time now to dig in myself and you seem to have a mastery of this shit.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3112 2017-10-21 20:40:21

klingt.net
Member
Registered: 2014-03-10
Posts: 22

Re: unofficial linux-ck repo with cpu optimized packages is ONLINE

Is 4.13.7 not released yet? I am asking because builds for this kernel version are available in the repo (http://repo-ck.com/x86_64/) but there are no signature files so I can't update.

Last edited by klingt.net (2017-10-21 20:40:35)

Offline

#3113 2017-10-21 22:31:37

loqs
Member
Registered: 2014-03-06
Posts: 2,804

Re: unofficial linux-ck repo with cpu optimized packages is ONLINE

@graysky something like /usr/lib/udev/rules.d/60-scheduler.rules

ACTION=="add|change", KERNEL=="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|scm*|pmem*|nbd*", ATTR{queue/scheduler}="bfq"

That will try and set the scheduler to bfq for every block device of every type,  this will ignore elevator kernel option.
As linux-ck is currently configured following the arch linux package in the .config # CONFIG_SCSI_MQ_DEFAULT is not set
so the udev rule will only work for devices that do not use scsi_mod which as far as I understand effectively means NVME devices other devices will get cfq.
As there were issues with enabling CONFIG_SCSI_MQ_DEFAULT you could leave it off and ask users to add the kernel option scsi_mod.use_blk_mq=1 if they want bfq for none NVME devices.
scsi_mod.use_blk_mq=1 will enabled support at boot time for mod_scsi using devices to use multiqueue schedulers then the udev rule would work for all devices
(with the exception of device mapper based devices ( enabling dm_mod.use_blk_mq=1 will not change that the only device mapper target that supports mq is the multipath target ) )
If users want something else same as with other udev rules override using /etc/udev/rules.d/60-scheduler.rules to disable link to /dev/null

diff --git a/block/elevator.c b/block/elevator.c
index dac99fbfc273..fbcdba53a3aa 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -229,7 +229,7 @@ int elevator_init(struct request_queue *q, char *name)
                 */
                if (q->mq_ops) {
                        if (q->nr_hw_queues == 1)
-                               e = elevator_get("mq-deadline", false);
+                               e = elevator_get("bfq", false);
                        if (!e)
                                return 0;
                } else

Alternative one line patch swaps mq-deadline to bfq still only applies to multiqueue enabled devices so again only NVME's unless users add scsi_mod.use_blk_mq=1 or the CONFIG_SCSI_MQ_DEFAULT is enabled in .config

Perhaps take a survey of if users want bfq as default or are they happy to set it themselves?

Offline

#3114 Yesterday 10:41:26

graysky
Member
From: /usr/share/zoneinfo/US/Eastern
Registered: 2008-12-01
Posts: 9,225
Website

Re: unofficial linux-ck repo with cpu optimized packages is ONLINE

@klingt.net - Correct.  I am trying to sort out this bfq crap first.  4.13.9 is ready with that exception.
@loqs - Thanks for the detailed reply.

I don't want to ship a udev rule and make assumptions for users...  polling will likely give two different sets of opinions.  A 3rd option is to follow what linux-zen does as you wrote:

loqs wrote:

https://github.com/zen-kernel/zen-kerne … d5d926bac4
The change that enables bfq by default is effectively one line in block/elevator.c that switches  e = elevator_get("mq-deadline", false); to e = elevator_get("bfq", false); if #if defined(CONFIG_ZEN_INTERACTIVE) && defined(CONFIG_IOSCHED_BFQ)
That would enable bfq by default with a one line change if you enabled CONFIG_SCSI_MQ_DEFAULT in the .config

sq-bfq the bfq for when multiqueue is off also the bfq from before it was merged into mainline is https://github.com/zen-kernel/zen-kerne … -iosched.c

So if I understand correctly, the following 2 changes will cure this issue.  Am I correct?

1) Include the patch to block/elevator.c that you referenced.
2) Switch the .config as follows:

-# CONFIG_SCSI_MQ_DEFAULT is not set
+CONFIG_SCSI_MQ_DEFAULT=y

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3115 Yesterday 10:52:56

loqs
Member
Registered: 2014-03-06
Posts: 2,804

Re: unofficial linux-ck repo with cpu optimized packages is ONLINE

Yes with that .config change none NVME's will be switched to use multiqeue and the patch to block/elevator.c will swap the default elevator for multiqueues from mq-deadline to bfq.
This would seem to be the best the can be achieved without bringing back the none multiqeue version of bfq which would be a much bigger patch.
Would suggest you add it to the AUR package first then do then get some feedback before pushing all the optimized builds to repo-ck.

Offline

#3116 Yesterday 12:18:56

graysky
Member
From: /usr/share/zoneinfo/US/Eastern
Registered: 2008-12-01
Posts: 9,225
Website

Re: unofficial linux-ck repo with cpu optimized packages is ONLINE

@loqs - I made those two changes in 4.13.9-1 (see here) but looking at linux-zen's config, there are others relating the IO scheduler...

With the changes, I get a proposed config:

CONFIG_DEFAULT_BFQ=y
CONFIG_DEFAULT_IOSCHED="bfq"

Looking at the config for linux-zen it seems:

CONFIG_DEFAULT_BFQ_SQ=y
CONFIG_DEFAULT_IOSCHED="bfq-sq"

Is this to be expected?

Last edited by graysky (Yesterday 12:41:46)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3117 Yesterday 16:35:38

loqs
Member
Registered: 2014-03-06
Posts: 2,804

Re: unofficial linux-ck repo with cpu optimized packages is ONLINE

keep patch -Np1 -R -i "../0015-Enable-and-make-BFQ-default-IO-scheduler-overriding-.patch so CONFIG_DEFAULT_BFQ will not exists and CONFIG_DEFAULT_IOSCHED="cfq"
in the .config you can only set the default for none mq elevators (unless some kernel checks are altered/removed) in linux-zen they added back the old none mq bfq as bfq-sq and set that as default
linux-zen uses sq-bfq as the default for none mq devices set using .config (instead of turning them into mq devices) and uses bfq as the default for mq devices set in the source.
If you want to proceed that way you would keep you would need the patches from https://github.com/zen-kernel/zen-kerne … -iosched.c and would disable # CONFIG_SCSI_MQ_DEFAULT is not set

Offline

#3118 Yesterday 16:59:07

graysky
Member
From: /usr/share/zoneinfo/US/Eastern
Registered: 2008-12-01
Posts: 9,225
Website

Re: unofficial linux-ck repo with cpu optimized packages is ONLINE

loqs - I don't have hardware for proper testing (all nvme now) and I have limited time to put into it.  My preference is to wait for ck to handle it with ck2 but I don't know when that will be.  Are you willing and able to put something together for me in the form of a patched PKGBUILD + needed files?  We can push it to the AUR as 4.13.9-2 for testing and feedback.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3119 Yesterday 17:50:21

loqs
Member
Registered: 2014-03-06
Posts: 2,804

Re: unofficial linux-ck repo with cpu optimized packages is ONLINE

The PKGBUILD you have now will work because CONFIG_SCSI_MQ_DEFAULT=y having 0015-Enable-and-make-BFQ-default-IO-scheduler-overriding-.patch enabled again will make no difference
it sets CONFIG_DEFAULT_IOSCHED="bfq" the kernel will ignore it with CONFIG_SCSI_MQ_DEFAULT=y but will use bfq anyway as that is what the new patch has hardcoded in the kernel.
If you wanted to with the next release you could revert 0015-Enable-and-make-BFQ-default-IO-scheduler-overriding-.patch again as it achieves nothing.
Now we wait and see if anything is broken with the changes.

Offline

#3120 Yesterday 17:56:47

graysky
Member
From: /usr/share/zoneinfo/US/Eastern
Registered: 2008-12-01
Posts: 9,225
Website

Re: unofficial linux-ck repo with cpu optimized packages is ONLINE

@loqs - I'd rather keep it simple and omit that revert.  If the config change + the new patch works, I am happy to leave 4.13.9-1 as-is.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3121 Yesterday 19:13:04

inglor
Member
Registered: 2008-07-22
Posts: 51

Re: unofficial linux-ck repo with cpu optimized packages is ONLINE

I just build linux-ck from AUR and with no udev rules or kernel params on a mix handware (I have HDDs, SDDs & NVME)

$ cat /sys/block/nvme0n1/queue/scheduler
[none] mq-deadline kyber bfq
$ cat /sys/block/sd{a,b,c,d,e}/queue/{scheduler,rotational}
[mq-deadline] kyber bfq none
0
[mq-deadline] kyber bfq none
0
[mq-deadline] kyber bfq none
1
[mq-deadline] kyber bfq none
1
[mq-deadline] kyber bfq none
1

Is it normal for nvme to have none selected? I guess I have to create a simple udev rule to assign the bfq to all sd* right?

Offline

#3122 Yesterday 20:16:43

loqs
Member
Registered: 2014-03-06
Posts: 2,804

Re: unofficial linux-ck repo with cpu optimized packages is ONLINE

inglor please try the following from the linux-ck directory

$ curl -o linux-ck.patch https://pastebin.com/raw/JwrJPFzy
$ cd src/linux-4.13/
$ patch -p1 -R -i ../unfuck_bfq.patch
$ patch -p1 -i ../../linux-ck.patch
$ cd ../..
makepkg -e

That should fix the issue for the none NVME's
to try and fix the issue for NVME's as well please have another kernel installed in case the result is a none booting kernel

$ curl -o linux-ck-nvme.patch https://pastebin.com/raw/Rr6t2zYK
$ cd src/linux-4.13/
$ patch -p1 -R -i ../../linux-ck.patch
$ patch -p1  -i ../../linux-ck-nvme.patch
cd ../..
makepkg -e

edit:
reworked post after getting a pastebin to work
edit:
@graysky created a github repo with adjusted PKGBUILDs in two branches one only does the none NVME devices and the other does everything https://github.com/loqs/linux-ck-aur
I do not have an NVME device so I can not test if that patch works or not.  CK's patch setting bfq as the default scheduler is left in as per your request.

Last edited by loqs (Yesterday 23:40:16)

Offline

#3123 Yesterday 23:42:52

graysky
Member
From: /usr/share/zoneinfo/US/Eastern
Registered: 2008-12-01
Posts: 9,225
Website

Re: unofficial linux-ck repo with cpu optimized packages is ONLINE

Alright gang.  The 4.13.x series should be live in the repo shortly.  The push to vbox driver 5.2.0 jacked up my build script and I can't troubleshoot tonight so you'll have to build your own from AUR until I get debug and fix.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3124 Today 00:00:53

loqs
Member
Registered: 2014-03-06
Posts: 2,804

Re: unofficial linux-ck repo with cpu optimized packages is ONLINE

Reviewing what linux-zen does it sets bfq for none NVME devices if mq is enabled but it does not enable mq for none NVME devices so they get sq-bfq.
NVME devices get the none scheduler sorry for misreading what the code did before.  Will test the  bfq-none-nvme branch as soon as build finishes.
bfq-none-nvme branch boots without issue default scheduler for none NVME's is set to bfq.
edit:
bfq-including-nvme branch is currently broken.
edit:
bfq-including-nvme build issue is fixed and boots on none NVME hardware unable to test more.
edit:
To test

$ cd linux-ck-aur/
$ git clone https://github.com/loqs/linux-ck-aur.git
$ git checkout bfq-including-nvme # or bfq-none-nvme for the patch the only changes the default for none nvme devices
$ makepkg

Then install as usual please ensure you have a fallback bootable kernel

Last edited by loqs (Today 01:31:07)

Offline

Board footer

Powered by FluxBB