1. Rework codes in __schedule() and sched_fork(). These are minor changes, but will somehow help to reduce overhead.
Enjoy BMQ for your linux kernel.
Full kernel tree repository can be found at https://gitlab.com/alfredchen/linux-bmq
And all-in-one patch can be found at gitlab.
Bug report at https://gitlab.com/alfredchen/bmq/issues
Thank you very much.
ReplyDeleteWhen I used CK1 patch (5.5) all cores would be maxed out at 100% during kernel compiling.
ReplyDeleteWith this BMQ patch they will be around 50% max.
Kernel compiling takes much longer of course.
Did this happen with previous patch?
DeletePrevious kernel and patch?
What is the CPU?
What is the OS and it's version?
Yes.
DeleteYes.
Xeon E5620.
Slackware-current.
It doesn't happen with vanilla or ck/muqss.
Pls post "dmesg | grep -i bmq" output on a 5.6 BMQ kernel, I'd check the topology setup.
DeleteDuring kernel compiling, all 4 cores have cpu load?!
[ 0.108934] bmq: BMQ CPU Scheduler 5.6-r3 by Alfred Chen.
Delete[ 0.353333] bmq: cpu#00 affinity mask: 0x0000000e - coregroup
[ 0.353334] bmq: cpu#00 llc_id = 0, llc_mask idx = 0
[ 0.353419] bmq: cpu#01 affinity mask: 0x0000000d - coregroup
[ 0.353420] bmq: cpu#01 llc_id = 0, llc_mask idx = 0
[ 0.353500] bmq: cpu#02 affinity mask: 0x0000000b - coregroup
[ 0.353501] bmq: cpu#02 llc_id = 0, llc_mask idx = 0
[ 0.353581] bmq: cpu#03 affinity mask: 0x00000007 - coregroup
[ 0.353582] bmq: cpu#03 llc_id = 0, llc_mask idx = 0
Yes all cores have load but only 50% on average max.
Gcc is only one thread despite putting "-j 4" into MAKEFLAGS.
DeleteI used the additional parameter -l now all cores are used.
Deleteexport MAKEFLAGS="-j -l $(getconf _NPROCESSORS_ONLN)"
The low priority issue still persists though.
I am a little confused here, the last anonymous are the same person?
DeleteAnd what the low priority issue is?
Yes same.
DeleteI think everything is resolved now.
Good to know you resolve it. :)
DeleteResponsiveness is amazing.
ReplyDeleteAlfred, this has been bothering me for a long time, but finally I've decided to report it to you.
ReplyDeleteGiven I have 4 CPUs. I run foldingathome (or another CPU-bound app) with idle priority. It maxes out to all CPUs and performs fine. Then I decide to run KVM VM with higher than idle priority, but the qemu process stalls on the RCU synchronization point (a) (please see the stacktrace via link below [1]).
At the same time, RCU GP kworker eats 100% of CPU time doing nothing. I either see en empty stack, or stack (b), or stack (c).
Once I send a SIGSTOP to foldingathome aka idle app, things get back to normal, and qemu starts fine.
Do you think this is some kind of priority inversion issue? Can you reproduce it locally?
Thanks.
[1] https://gitlab.com/snippets/1968570
Basically, it seems it doesn't even need different priorities. I was able to reproduce it with a couple of parallel dd from /dev/zero to /dev/null, and all dd and qemu had default priorities.
DeleteSo I guess the thing that matters is being CPU-bound.
I also noticed a priority issue during my kernel compiling^^ htop shows a unusual high amount of "low priority" in the cpu usage bar.
Deletehttps://i.imgur.com/QM3ykfH.png
@Anonymous
DeleteThat's result of boost priority auto adjustment in BMQ has kicked in. When doing kernel compiling, compiler tasks usually used full time slice then they get de-boost to lower priority, while other tasks which use short time slice or sleep for a long time will get boost to higher priority.
@pf
DeleteI may need some time to reproduce it locally. Would you pls report a bug so I can trace it easier(and keep the record too).
Reported here: https://gitlab.com/alfredchen/bmq/-/issues/16
Delete@Oleksandr & @Alfred:
DeleteBesides your discussion in https://gitlab.com/alfredchen/bmq/-/issues/16,
I find the settings of "threadirqs rcu_nocbs=0-Mx io_delay=none" (with Mx == max CPU No.) quite interesting to test with BMQ. In my subjective experience, it looks like to be beneficial to interactiveness.
Many thanks to both of you for your thorough work for Linux,
best regards,
Manuel
Those settings should works for all schedulers, not only BMQ.
Delete:-)
DeleteYes, of course. I just wanted to get it out of the cave (the outsourced bug discussion)...
In case someone else on here wants to play with one or more of these settings.
Manuel