[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ca3bcede-2289-4e51-a2db-0da75d85fcbc@redhat.com>
Date: Fri, 29 Aug 2025 16:12:23 -0400
From: Waiman Long <llong@...hat.com>
To: Chen Ridong <chenridong@...weicloud.com>, tj@...nel.org,
hannes@...xchg.org, mkoutny@...e.com
Cc: cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
lujialin4@...wei.com, chenridong@...wei.com
Subject: Re: [PATCH -next RFC 08/11] cpuset: refactor acpus_validate_change
On 8/28/25 8:56 AM, Chen Ridong wrote:
> From: Chen Ridong <chenridong@...wei.com>
>
> Refactor acpus_validate_change to handle the special case where
> cpuset.cpus can be set even when violating partition sibling CPU
> exclusivity rules. This differs from the general validation logic in
> validate_change. Add a wrapper function to properly handle this
> exceptional case.
>
> Since partition invalidation status can be determined by trialcs->prs_err,
> the local variable 'bool invalidate' can be removed.
>
> Signed-off-by: Chen Ridong <chenridong@...wei.com>
> ---
> kernel/cgroup/cpuset.c | 83 +++++++++++++++++++++++-------------------
> 1 file changed, 45 insertions(+), 38 deletions(-)
>
> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
> index 71190f142700..75ad18ab40ae 100644
> --- a/kernel/cgroup/cpuset.c
> +++ b/kernel/cgroup/cpuset.c
> @@ -2410,43 +2410,11 @@ static bool invalidate_cs_partition(struct cpuset *cs)
> return false;
> }
>
> -/**
> - * update_cpumask - update the cpus_allowed mask of a cpuset and all tasks in it
> - * @cs: the cpuset to consider
> - * @trialcs: trial cpuset
> - * @buf: buffer of cpu numbers written to this cpuset
> - */
> -static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs,
> - const char *buf)
> +static int acpus_validate_change(struct cpuset *cs, struct cpuset *trialcs,
> + struct tmpmasks *tmp)
What does "acpu" stand for? I suppose it means cpus_allowed. I will
suggest to use a more descriptive name even if it is longer. I did use
xcpus for exclusive_cpus, but 'x' is a seldomly used English alphabet
that can associate with exclusive_cpus rather easily, but 'a' is not.
Cheers,
Longman
Powered by blists - more mailing lists