]> git.proxmox.com Git - mirror_lxcfs.git/commitdiff
cgroup v2: return cpuset cpu count when no quota is set
authormichuan <michu_an@126.com>
Mon, 4 Jul 2022 02:49:49 +0000 (10:49 +0800)
committermichuan <michu_an@126.com>
Mon, 4 Jul 2022 02:49:49 +0000 (10:49 +0800)
Signed-off-by: michuan <michu_an@126.com>
src/proc_cpuview.c

index 8e83174b326cf3ad8ba579fd3bd48fdb1451113c..db69de81ce8d6f5a2428f96e13a0e45865120819 100644 (file)
@@ -466,7 +466,7 @@ static bool cfs_quota_disabled(const char *cg)
 
 /*
  * Return the maximum number of visible CPUs based on CPU quotas.
- * If there is no quota set, zero is returned.
+ * If there is no quota set, cpu number in cpuset value is returned.
  */
 int max_cpu_count(const char *cg)
 {
@@ -476,10 +476,10 @@ int max_cpu_count(const char *cg)
        int nr_cpus_in_cpuset = 0;
 
        if (!read_cpu_cfs_param(cg, "quota", &cfs_quota))
-               return 0;
+               cfs_quota = 0;
 
        if (!read_cpu_cfs_param(cg, "period", &cfs_period))
-               return 0;
+               cfs_period = 0;
 
        cpuset = get_cpuset(cg);
        if (cpuset)