Snakeoil Forums

Full Version: cpuset and TOP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Agent Kith,
I'm keen to do more with CPU affinity. Ultimately, it would be great if there was something like a 3rd group that could reserve a CPU for special user defined PIDs or IRQs.
[I'm ignorant about any differences between PIDs and IRQs in this context]

First up, could you modify TOP to show the last used CPU?
Currently, I ssh TOP, hit F, scroll down to P, hit space and then escape to see this info in Terminal.

The main consumer of CPU power in my system is irq/127-xhci_hc
I'm guessing this relates to the USB output to my DAC. That is the one for which I'd like to separately assign a CPU core.

For many weeks, I have assigned CPU#3 to User, leaving #0, #1 & #2 for System. Initially when I started playing with cpuset and monitoring last used CPU, I saw that IRQ127-xh followed system (CPU#0, 1 or 2). Later it seemed to always follow User (always on CPU#3 for weeks once stopped making changes in cpuset).  Today, I changed to CPU#2 & CPU#3 for User and notiiced that IRQ127-xh was using the system cores again. Back to User=CPU#3 only...IRQ still using System cores...restart...now IRQ pinned to User CPU#3.

Perhaps this is why I didn't hear much immediate effect when playing with cpuset but felt SQ was improved long-term.

Cheers,
JD
(02-Sep-2018, 10:57 AM)JD1 Wrote: [ -> ]Hi Agent Kith,
I'm keen to do more with CPU affinity. Ultimately, it would be great if there was something like a 3rd group that could reserve a CPU for special user defined PIDs or IRQs.
[I'm ignorant about any differences between PIDs and IRQs in this context]

First up, could you modify TOP to show the last used CPU?
Currently, I ssh TOP, hit F, scroll down to P, hit space and then escape to see this info in Terminal.
TOP is kind of dumb that way. You can however, save your current view by pressing 'W'. However I believe this will be overwritten next time you install a firmware as I believe I used TOP to display somethiing different from the default (cannot remember what that is now).

(02-Sep-2018, 10:57 AM)JD1 Wrote: [ -> ]The main consumer of CPU power in my system is irq/127-xhci_hc
I'm guessing this relates to the USB output to my DAC. That is the one for which I'd like to separately assign a CPU core.
At the moment you can't do this in the GUI. I'd improve on this in the future, but until then, you can just run cpuset from the commandlinei to partition the processes the way you want it.

My 2c though, the idea though is not to isolate the cores to give them 'maximum availability'. It is to make sure the memory regions used by your music processes etc can be 'transferred efficiently' across each other. e.g. it makes sense to assign everything related to music to a single core, so that the CPU can hopefully make it more efficient to transfer the pages from one to another.

Placing them in seperate CPUs may defeats the purpose in terms of effiency.. However, there's always a chance something inefficient may actually sound better..

Hopefully I can improve on this GUI so you guys can tweak it to whatever you like to find the sound you live. Thumbs Up

(02-Sep-2018, 10:57 AM)JD1 Wrote: [ -> ]For many weeks, I have assigned CPU#3 to User, leaving #0, #1 & #2 for System. Initially when I started playing with cpuset and monitoring last used CPU, I saw that IRQ127-xh followed system (CPU#0, 1 or 2). Later it seemed to always follow User (always on CPU#3 for weeks once stopped making changes in cpuset).  Today, I changed to CPU#2 & CPU#3 for User and notiiced that IRQ127-xh was using the system cores again. Back to User=CPU#3 only...IRQ still using System cores...restart...now IRQ pinned to User CPU#3.
This sounds like a bug, I'd look into it when I can.. In theory the kernel don't do hyper threading, but just in case - do you have hyper threading on? If yes, can you disable that?

[quote="JD1" pid='1857' dateline='1535857037']
Perhaps this is why I didn't hear much immediate effect when playing with cpuset but felt SQ was improved long-term.
This cpuset feature is a big change in my setup.. As always, it's a YMMV thing. For now, if you can manually experiment with cpu sets in the command line.. And let me know what works best for you.. Then I'd see if I can find a good user interface to make this work.
Thanks for the reply AK.

I have hyper-threading disabled in BIOS.

Yes I believe you about sharing a core. Single core for user sounded best to me. I'm still speculating that it worked better for you because you also have all system processes on a single core. Worst for me was when I tried 2 cores for each.

Could you lead me in the right direction about using ssh to set CPU affinities?

Cheers,
JD
(02-Sep-2018, 01:54 PM)JD1 Wrote: [ -> ]Thanks for the reply AK.

I have hyper-threading disabled in BIOS.

Yes I believe you about sharing a core. Single core for user sounded best to me. I'm still speculating that it worked better for you because you also have all system processes on a single core. Worst for me was when I tried 2 cores for each.

Could you lead me in the right direction about using ssh to set CPU affinities?

Cheers,
JD

CPUset is slightly different to CPU affinities... The former is assigning a group of CPU into a group, and then you can define what processes to run in that group. To make it work with what you want you would probably need to define four CPUsets, one for each core.

Here's the tutorial on how to use cset to set things up:

https://github.com/lpechacek/cpuset/blob...torial.txt

Play around with it and see what happens. If there is a problem just reset the PC and all should be working again.
Thanks for the tips AK. I've been playing around with cset. More learning commands than listening to music so only 1st impressions but I'm liking this: irq/127-xhci_hc plus Squeezelie-R2 on one core and the 4 other LMS/SL PIDs on another. BTW; irq/127 seems to start off in system cpuset, even when it was using the user core. Moving that one was my biggest challenge.


[Image: Screen_Shot_2018_09_03_at_6_12_40_pm.png]
[Image: Screen_Shot_2018_09_03_at_6_11_48_pm.png]