cpuset and TOP
#1
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
Reply

#2
(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.
Snakeoil Operating System - Music, your way!
Reply

#3
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
Reply

#4
(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.
Snakeoil Operating System - Music, your way!
Reply

#5
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]
[-] The following 1 user Likes JD1's post:
  • agent_kith
Reply



Bookmarks

Possibly Related Threads…
Thread Author Replies Views Last Post
  Extending cpuset to include user processes Snoopy8 6 1,222 13-Dec-2022, 02:03 PM
Last Post: Snoopy8



Users browsing this thread:
1 Guest(s)

[-]
Our Sponsors

[-]
Welcome
You have to register before you can post on our site.

Username/Email:


Password:





[-]
Latest Threads
ZimaBoard 2x NIC, 2x SATA, 2x USB, 1x PC...
Last Post: agent_kith
26-Mar-2024 12:04 PM
» Replies: 13
» Views: 605
LMS Upgrade ?
Last Post: uglymusic
15-Mar-2024 09:14 PM
» Replies: 7
» Views: 146
Squeezebox shutdown
Last Post: TripleX
13-Mar-2024 07:34 AM
» Replies: 4
» Views: 69
MP3 Not Playing
Last Post: Coacharnold
10-Mar-2024 10:25 AM
» Replies: 3
» Views: 52
Fail to install myMPD
Last Post: hkphantomgtr
03-Mar-2024 08:45 PM
» Replies: 9
» Views: 195
Intel HFI Driver Can "Save Tons Of CPU C...
Last Post: hkphantomgtr
28-Feb-2024 09:15 PM
» Replies: 0
» Views: 41
Announcing Snakeoil Measurements 1.3.0
Last Post: agent_kith
26-Feb-2024 10:02 PM
» Replies: 94
» Views: 4120
More Problems with Squeezelite in 1.3
Last Post: Coacharnold
17-Feb-2024 09:47 PM
» Replies: 2
» Views: 69
Snakeoil Music server & Snakeoil its own...
Last Post: Snoopy8
17-Feb-2024 11:20 AM
» Replies: 8
» Views: 364
RoonBridge (64 bit only)
Last Post: scrarfussi
15-Feb-2024 08:26 PM
» Replies: 3
» Views: 4123

[-]
SnakeoilOS Mission Statement

Our mission is to create a free to use computer OS that is easy to install, intuitive to operate and play music that will connect and engage with you emotionally.

SnakeoilOS gives you the freedom to spend more time on listening, enjoying and exploring music. Wasting time on computers is now a thing of the past! Everything is constantly evolving/improving. Please check back often for updates.

If you like this project, do show your support with a small token donation. All donations collected will be used to run this website, and for purchasing new equipment for the project.


Powered By MyBB, © 2002-2024. Theme © Melroy van den Berg.