# cset shield --cpu=1-3
On a 4-way machine, this command will dedicate the first processor, CPU0, for the system
set (unshielded) and the last three processors, CPU1, CPU2, CPU3, for the user set
The CPUSPEC will accept a comma separated list of CPUs and inclusive range specifications.
For example, --cpu=1,3,5-7 will assign CPU1, CPU3, CPU5, CPU6, and CPU7 to the user (or
shielded) cpuset and the inverse of that to the system (or unshielded) cpuset.
If you do not like the names "system" and "user" for the unshielded and shielded sets
respectively, or if those names are used already, then use the --sysset and --userset
But my question was not if I want to use isolcpus, but how to do it in Dietpi as there is a chain of start up events in Dietpi which are Dietpi specific.
I have read those articles as well before. I am not sure if that is the best way for my use case though: I have two CPUs with 4 cores each on my XU4. One CPU shall only be used for critical audio related processes and interrupts, so Network, USB and MPD itself. Each of them gets its own isolated core on the same physical CPU sharing the same cache
The other CPU with another 4 cores can handle with normal scheduler enabled all the other system tasks andapps like lighttpd, SSH etcetc.
So, the original provocated statement of that article “isolcpus is depreciated” I cant follow. Isolcpus does exectly what I want as my overall target is to minimize jitter and isolcpus works on that front very well:
I think I found it:
to the # Kernel command-line parameters line Within " "
Just tested it, works like a charme…and the best is, that the dietpi-services CPU-affinity for a services works with it as well.
Sorry having asked such a beginners questions, but there are so many tutorials out there which are for other plattforms or other versions etc…I got a bit confused and could not find it.
Now, the next step would be:
Two Scripts which automated my manual settings:
Script “ISO”: Which changes the boot.ini and the dietpi-services Cpu-Affinity for MPD, Network and USB
Script “ORG”: Which basiacally brings all back to previsous defaults, so un-doing all the stuff of “ISO”.
I want to compare the audible effect of the settings change and it is important to do the easy and quick, other wise your brain is already confused and you hear stuff which is not there (psychoacoustical phenomen)…
…so any hints how to that are highly appreciated (I am obvisouly an enthusistic bloody beginner)
Completely independent of the DietPi-specific systemd services and boot order, this needs to be added to the kernel command-line. Where this can be edited is specific to the SBC, so no wonder that tutorials out there may not be helpful . The Odroid XU4 uses an older vendor kernel and bootloader, so /boot/boot.ini is correct there. On RPi it would be /boot/cmdline.txt, on other SBCs /boot/armbianEnv.txt or /boot/dietpiEnv.txt and on x86_64 /etc/dafault/grub + update-grub.
I just wanted to mention the per-process/service CPU affinity, but you found that already .
Scripting the boot.ini change should be simple?
Scripting dietpi-services is not possible, since it has no CLI for those settings. But you can set the CPU affinities manually once, then check the files /etc/systemd/system/<name>.service.d/dietpi-process_tool.conf. Those contain the per-service systemd settings overrides created by dietpi-services. So you can script the creation of these config files/overrides. Without a reboot changes can be applied via:
systemctl daemon-reload # let systemd reread the systemd units/config files
systemctl restart <name> # restart the service called <name>
I am now working on the C2 which has dietpiEnv.txt instead of boot.ini…
when i put isolcpus=3 in there, the boot takes 5 min and in the end nothing happened…
imlooked into boot.cmd and it looks like that the kernel commands are hardcoded, no ? so variables, but i cant see that a new command like isolcpus will be accepted…but i am not an experts in these kind of scripts.
What would be the right wqy of putting isolcpus into c2 then ? boot.cmd and recompile ?
I tried that, unfortunately it does not work. Is there a specific order where to place it in dietpiEnv.txt?
What worked is to add it into the Kernel command string at the end in boot.cmd and recompile boot.scr
But…I would love to do it the right way as you suggested in dietpiEnv.txt…
Your hint on the scripts for switching services affinities work like a charme…I can now switch back and fore in 2 sec to listen to the difference…and I will include the deidication of hardware IRQ to separate isolated cores as well, so we have eth0, USB (USB-DAC), and MPD sitting each on isolated cores and CPU0 for the housekeeping non-isolated
There is no isolcpus=3 at the extraargs line in /boot/dietpiEnv.txt. The hardcoded entry in /boot/boot.scr seems to be present. It has a binary header, so the grep output is expected.
Please try to remove isolcpus=3 from boot.cmd, then recompiled boot.scr, assure that isolcpus=3 is not within boot.scr (open with nano to be 100% sure), then add to /boot/dietpiEnv.txt the way I posted further above, and see whether this works as expected. You can also verify the current cmdline via:
That /apt/ index looks wrong, at least not default Armbian repository. Please show:
It should be:
deb http://apt.armbian.com/ bullseye main
hence no /apt/ path element. If this is a mirror, then obviously it isn’t reachable.
EDIT: Ah, I think it is the result of the mirror redirector. So then the mirror near you is down. Can you run apt update and show the full URL of the mirror?
grep 'isolcpus=3' /boot/boot.cmd
doesn’t generate any output and then nano /boot/boot.scr that it really does contain isolcpus=3 (in plain text area below the binary header, which is only a one-line hash). If so, please show the command you use to recompile it. Also try to do a reboot, verify that nano /boot/boot.cmd does still not contain isolcpus=3. If so, there is no chance that re-compiling boot.scr contains it, as long as you do really use /boot/boot.cmd as input.
I did used your statement above…I could not use a different one…as I can only do copy and paste…and yes, it was not in cmd, but still in scr…which is weird…I will now set the system new up and retry if the is reproducable
The URLs I will chcek in a moment…I am again installing now…but something is here fundamentally wrong as I cant SSH after reboot…no connection…connection only comes back afer I plugged the power.
cat: /etc/apt/sources.list.d/armbian.list: No such file or directory
Hit:1 https://deb.debian.org/debian bullseye InRelease
Hit:2 https://deb.debian.org/debian bullseye-updates InRelease
Hit:3 https://deb.debian.org/debian-security bullseye-security InRelease
Hit:4 https://deb.debian.org/debian bullseye-backports InRelease
Err:5 http://armbian.hosthatch.com/apt bullseye InRelease
Connection failed [IP: 2a01:6f0:ffff:5663::1 80]
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://apt.armbian.com/dists/bullseye/InRelease Connection failed [IP: 2a01:6f0:ffff:5663::1 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.
The good news: isolcpus in dietpiEnv.txt works now. The trick was to write it with one space into the first line and not into a new line…if now NOHZ_full would work as well, I would be in audio paradise…