mirror of
https://git.proxmox.com/git/pve-common
synced 2025-08-02 22:02:36 +00:00
cpuset: cgroupv2 support
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
dd13f1836f
commit
7c3db4b80c
@ -25,9 +25,17 @@ sub new_from_cgroup {
|
||||
sub new_from_path {
|
||||
my ($class, $path, $effective) = @_;
|
||||
|
||||
my $kind = $effective ? 'effective_cpus' : 'cpus';
|
||||
my $filename;
|
||||
if ($effective) {
|
||||
$filename = "$path/cpuset.effective_cpus";
|
||||
if (!-e $filename) {
|
||||
# cgroupv2:
|
||||
$filename = "$path/cpuset.cpus.effective";
|
||||
}
|
||||
} else {
|
||||
$filename = "$path/cpuset.cpus";
|
||||
}
|
||||
|
||||
my $filename = "$path/cpuset.$kind";
|
||||
my $set_text = PVE::Tools::file_read_firstline($filename) // '';
|
||||
|
||||
my ($count, $members) = parse_cpuset($set_text);
|
||||
|
Loading…
Reference in New Issue
Block a user