[Devel] [PATCH vz10 1/2] sched: Clean up vCPU handling logic

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Mon Mar 16 19:05:08 MSK 2026


>  static void tg_update_cpu_limit(struct task_group *tg)
>  {
>  	long quota, period;
> @@ -10059,14 +10003,13 @@ static void tg_update_cpu_limit(struct task_group *tg)
>  	}
>  
>  	tg->cpu_rate = rate;
> -	tg->nr_cpus = 0;

We need a comment about this hunk in thed commit message, that we explicitly decided to remove this line so that setting cpu.max does not override nr_cpus.

>  }
>  
> -static int tg_set_cpu_limit(struct task_group *tg,
> -			    unsigned long cpu_rate, unsigned int nr_cpus)
> +static int tg_set_cpu_limit(struct task_group *tg, unsigned int nr_cpus)
>  {
>  	int ret;
>  	unsigned long rate;
> +	unsigned long cpu_rate = tg->cpu_rate;
>  	u64 quota = RUNTIME_INF;
>  	u64 burst = tg_get_cfs_burst(tg);
>  	u64 period = default_cfs_period();


More information about the Devel mailing list