I have two 32 vCPU instances on AWS/GCP. I'm trying to set up cpu shielding so that CPUs 0, 1 are used by the system, and cpus 2-31 are shielded and only used explicitly by userspace threads.
System info:
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
$ cat /proc/filesystems | grep cpuset
nodev cpuset
However, when I try to run cset shield
, I get an error to do with mounts:
mount: /cpusets: none already mounted on /run/credentials/systemd-sysusers.service.
cset: **> mount of cpuset filesystem failed, do you have permission?
I've dug a bit into the cset code, and it seems like the failing call is one to
$ sudo mount -t cpuset cpuset /cpusets
mount: /cpusets: cpuset already mounted or mount point busy.
/cpusets
is a newly created folder, and $ cat /proc/mounts | grep cpuset
is empty -- so cpuset doesn't seem to be mounted elsewhere.
Maybe relevant:
$ cat /proc/mounts | grep cgroup
cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot 0 0
My guess is that AWS/GCP use cpuset for the hypervisor, or something like that. Is it possible to isolate cpus on AWS/GCP? How can I go about it?