"Pinning" host to certain cores

piyopiyo

New Member
Jul 23, 2020
2
0
1
50
First, great work to the Proxmox folks. i have to say, the installation experience and general smoothness of getting VMs up and running have been better than most Linux distributions I've tried so hats off to you guys.

With isolcpus essentially deprecated now with newer Linux kernels (according to: Linux Kernel CL Parameters), it seems they are pushing for cpuset usage as a general replacement. I tested isolcpus with PVE 6.2-4 and indeed it seems like despite the kernel arguments, /sys/devices/system/cpu/present always seems to show all logical cores as being present. Is there any other way that I can test limiting the host to specific cores and its impact on VMs that have been dedicated cores via tasksets?

Thanks!
 
You can use the 'cset' utility to isolate cores *almost* as good as with isolcpus (some kernel tasks might be unmoveable).

Keep in mind however, that the assignment of VMs with taskset has to be done manually, for example via hook-scripts.
 
Hi Stefan,

Thanks...actually, I did come to this realization shortly after posting. I just install the cset package, isolated the CPUs, and then used the task sets to basically pin the VM to the specified cores. Seems to work fine.

Thanks!
Charlton
 
You can use the 'cset' utility to isolate cores *almost* as good as with isolcpus (some kernel tasks might be unmoveable).

Is this still valid approach? If so, how/where do I get the cset utility?

Here's what happens when I try to run it:

root@thibworldpx5:~# cset shield --shield -v
-bash: cset: command not found
and here's what happens when I try to install cset-shield

root@thibworldpx5:~# apt install cset-shield
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package cset-shield
 
Hi,
Is this still valid approach? If so, how/where do I get the cset utility?

Here's what happens when I try to run it:


and here's what happens when I try to install cset-shield
you can use the Debian package search in such cases. Here is the result, the package name is cpuset. Just mentioning that in PVE 7.3, CPU pinning/affinity can be configured easily (advanced settings for the VM's CPU in the UI), here are the docs. But maybe cset is required for your use case.
 
Thanks @fiona . I've installed cpuset, and have a good reference for next time I run into similar situation.

Just mentioning that in PVE 7.3, CPU pinning/affinity can be configured easily (advanced settings for the VM's CPU in the UI)

Yes, I started by setting CPU Affinity using GUI as well as bumping CPU units but am still encountering stuttering in VM (used for gaming). The GUI feature also doesn't allow one to move host system tasks to specific cores, e.g. 0-1, and configure kernel threads to run there, i.e. kthreads=on (unless I'm missing something).
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!