From: Waiman Long <llong@redhat.com>
To: Chen Ridong <chenridong@huaweicloud.com>,
tj@kernel.org, hannes@cmpxchg.org, mkoutny@suse.com
Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
lujialin4@huawei.com, chenridong@huawei.com
Subject: Re: [PATCH -next 3/3] cpuset: remove is_prs_invalid helper
Date: Mon, 22 Sep 2025 17:37:37 -0400 [thread overview]
Message-ID: <f5288f26-0d4a-4b89-8119-7c3b966df1fc@redhat.com> (raw)
In-Reply-To: <20250922130233.3237521-4-chenridong@huaweicloud.com>
On 9/22/25 9:02 AM, Chen Ridong wrote:
> From: Chen Ridong <chenridong@huawei.com>
>
> The is_prs_invalid helper function is redundant as it serves a similar
> purpose to is_partition_invalid. It can be fully replaced by the existing
> is_partition_invalid function, so this patch removes the is_prs_invalid
> helper.
>
> Signed-off-by: Chen Ridong <chenridong@huawei.com>
> ---
> kernel/cgroup/cpuset.c | 11 +++--------
> 1 file changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
> index 196645b38b24..52468d2c178a 100644
> --- a/kernel/cgroup/cpuset.c
> +++ b/kernel/cgroup/cpuset.c
> @@ -132,11 +132,6 @@ static bool force_sd_rebuild;
> #define PRS_INVALID_ROOT -1
> #define PRS_INVALID_ISOLATED -2
>
> -static inline bool is_prs_invalid(int prs_state)
> -{
> - return prs_state < 0;
> -}
> -
> /*
> * Temporary cpumasks for working with partitions that are passed among
> * functions to avoid memory allocation in inner functions.
> @@ -1767,7 +1762,7 @@ static int update_parent_effective_cpumask(struct cpuset *cs, int cmd,
> old_prs = new_prs = cs->partition_root_state;
>
> if (cmd == partcmd_invalidate) {
> - if (is_prs_invalid(old_prs))
> + if (is_partition_invalid(cs))
> return 0;
>
> /*
> @@ -1874,7 +1869,7 @@ static int update_parent_effective_cpumask(struct cpuset *cs, int cmd,
> * For invalid partition:
> * delmask = newmask & parent->effective_xcpus
> */
> - if (is_prs_invalid(old_prs)) {
> + if (is_partition_invalid(cs)) {
> adding = false;
> deleting = cpumask_and(tmp->delmask,
> newmask, parent->effective_xcpus);
> @@ -2964,7 +2959,7 @@ static int update_prstate(struct cpuset *cs, int new_prs)
> /*
> * Treat a previously invalid partition root as if it is a "member".
> */
> - if (new_prs && is_prs_invalid(old_prs))
> + if (new_prs && is_partition_invalid(cs))
> old_prs = PRS_MEMBER;
>
> if (alloc_tmpmasks(&tmpmask))
Acked-by: Waiman Long <longman@redhat.com>
next prev parent reply other threads:[~2025-09-22 21:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-22 13:02 [PATCH -next 0/3] cpuset: code cleanup and redundancy removal Chen Ridong
2025-09-22 13:02 ` [PATCH -next 1/3] cpuset: remove redundant special case for null input in node mask update Chen Ridong
2025-09-22 21:36 ` Waiman Long
2025-09-22 13:02 ` [PATCH -next 2/3] cpuset: remove impossible warning in update_parent_effective_cpumask Chen Ridong
2025-09-22 21:37 ` Waiman Long
2025-09-22 13:02 ` [PATCH -next 3/3] cpuset: remove is_prs_invalid helper Chen Ridong
2025-09-22 21:37 ` Waiman Long [this message]
2025-09-22 23:10 ` [PATCH 0/3] cpuset: code cleanup and redundancy removal Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f5288f26-0d4a-4b89-8119-7c3b966df1fc@redhat.com \
--to=llong@redhat.com \
--cc=cgroups@vger.kernel.org \
--cc=chenridong@huawei.com \
--cc=chenridong@huaweicloud.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lujialin4@huawei.com \
--cc=mkoutny@suse.com \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®