From: K Prateek Nayak <kprateek.nayak@amd.com>
To: peterz@infradead.org
Cc: aubrey.li@linux.intel.com, efault@gmx.de, gautham.shenoy@amd.com,
linux-kernel@vger.kernel.org, mgorman@techsingularity.net,
mingo@kernel.org, song.bao.hua@hisilicon.com,
srikar@linux.vnet.ibm.com, valentin.schneider@arm.com,
vincent.guittot@linaro.org
Subject: Re: [PATCH] sched/topology: Remove redundant variable and fix incorrect type in build_sched_domains
Date: Fri, 4 Mar 2022 09:18:21 +0530 [thread overview]
Message-ID: <9eedd162-440f-dfb4-e5c6-24ada28fe365@amd.com> (raw)
In-Reply-To: <20220218162743.1134-1-kprateek.nayak@amd.com>
Hello everyone,
Ping :)
On 2/18/2022 9:57 PM, K Prateek Nayak wrote:
> While investigating the sparse warning reported by the LKP bot [1],
> observed that we have a redundant variable "top" in the function
> build_sched_domains that was introduced in the recent commit
> e496132ebedd ("sched/fair: Adjust the allowed NUMA imbalance when
> SD_NUMA spans multiple LLCs")
>
> The existing variable "sd" suffices which allows us to remove the
> redundant variable "top" while annotating the other variable "top_p"
> with the "__rcu" annotation to silence the sparse warning.
>
> [1] https://lore.kernel.org/lkml/202202170853.9vofgC3O-lkp@intel.com/
>
> Fixes: e496132ebedd ("sched/fair: Adjust the allowed NUMA imbalance when SD_NUMA spans multiple LLCs")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
> ---
> kernel/sched/topology.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
> index e6cd55951304..4b757fb8f661 100644
> --- a/kernel/sched/topology.c
> +++ b/kernel/sched/topology.c
> @@ -2255,7 +2255,7 @@ build_sched_domains(const struct cpumask *cpu_map, struct sched_domain_attr *att
>
> if (!(sd->flags & SD_SHARE_PKG_RESOURCES) && child &&
> (child->flags & SD_SHARE_PKG_RESOURCES)) {
> - struct sched_domain *top, *top_p;
> + struct sched_domain __rcu *top_p;
> unsigned int nr_llcs;
>
> /*
> @@ -2280,11 +2280,9 @@ build_sched_domains(const struct cpumask *cpu_map, struct sched_domain_attr *att
> sd->imb_numa_nr = imb;
>
> /* Set span based on the first NUMA domain. */
> - top = sd;
> - top_p = top->parent;
> + top_p = sd->parent;
> while (top_p && !(top_p->flags & SD_NUMA)) {
> - top = top->parent;
> - top_p = top->parent;
> + top_p = top_p->parent;
> }
> imb_span = top_p ? top_p->span_weight : sd->span_weight;
> } else {
--
Thanks and Regards,
Prateek
next prev parent reply other threads:[~2022-03-04 3:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-18 16:27 [PATCH] sched/topology: Remove redundant variable and fix incorrect type in build_sched_domains K Prateek Nayak
2022-03-04 3:48 ` K Prateek Nayak [this message]
2022-03-04 12:56 ` Valentin Schneider
2022-03-04 13:49 ` Peter Zijlstra
2022-03-08 22:25 ` [tip: sched/core] " tip-bot2 for K Prateek Nayak
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=9eedd162-440f-dfb4-e5c6-24ada28fe365@amd.com \
--to=kprateek.nayak@amd.com \
--cc=aubrey.li@linux.intel.com \
--cc=efault@gmx.de \
--cc=gautham.shenoy@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@techsingularity.net \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=song.bao.hua@hisilicon.com \
--cc=srikar@linux.vnet.ibm.com \
--cc=valentin.schneider@arm.com \
--cc=vincent.guittot@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.