Have a 4 CPU Intel NUC and used this script for my mpd setup
#
# set up cpusets
#
cset set -c 0 -s system
cset set -c 1 -s irq --cpu_exclusive
cset set -c 2 -s player --cpu_exclusive
cset set -c 3 -s server --cpu_exclusive
#
# move music server and player threads
#
cset proc --move --toset=player --pid $(pgrep mpd) --threads
cset proc --move --toset=server --pid $(pgrep camilladsp) --threads
#
# move all unbound kernel threads to system cpuset, and usb irq to irq cpuset
#
cset proc -k -f root -t system
cset proc --move --toset=irq --pid $(pgrep irq/123-xhci_hc) --kthread --force
"cset proc --move --toset=player --pid $(pgrep mpd) --threads".
Ideally, to reduce latency, IRQs should be on a different CPU to the music threads. Some IRQs were bound to CPUs, but many of the IRQs were moved using the following:
- Edited /etc/default/irqbalance and set IRQBALANCE_BANNED_CPUS=C (hex mask value, run in CPUs 0,1 not in CPUs 2,3).
- Alternately, disabled or uninstalled IRQBalance and more IRQs will run on the first CPU (CPU0)
- Used "cset proc -k -f root -t system" to move some more IRQs
- Used "cset proc --move --toset=irq --pid $(pgrep irq/123-xhci_hc) --kthread --force" to move USB IRQ to its own CPU.
Some music threads could not be moved eg. Minimserver is Java based. These music threads should be started within a cpuset using a command similar to this:
"cset proc -s server -e /bin/bash -- /var/www/players/minimserver/start.sh"
Some useful information on cpusets
https://documentation.suse.com/sle-rt/15...model.html
https://documentation.suse.com/sle-rt/15...puset.html