All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH] sched/topology: Remove unused numa_distance in cpu_attach_domain()
@ 2021-09-15  6:31 Yicong Yang
  2021-09-16  9:42 ` Barry Song
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Yicong Yang @ 2021-09-15  6:31 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot, valentin.schneider, 21cnbao
  Cc: linux-kernel, song.bao.hua, prime.zeng, yangyicong

numa_distance in cpu_attach_domain() is introduced in
commit b5b217346de8 ("sched/topology: Warn when NUMA diameter > 2")
to warn user when NUMA diameter > 2 as we'll misrepresent
the scheduler topology structures at that time. This is
fixed by Barry in commit 585b6d2723dc ("sched/topology: fix the issue
groups don't span domain->span for NUMA diameter > 2") and
numa_distance is unused now. So remove it.

Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
---
 kernel/sched/topology.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index 4e8698e62f07..690bd1ab86f3 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -688,7 +688,6 @@ cpu_attach_domain(struct sched_domain *sd, struct root_domain *rd, int cpu)
 {
 	struct rq *rq = cpu_rq(cpu);
 	struct sched_domain *tmp;
-	int numa_distance = 0;
 
 	/* Remove the sched domains which do not contribute to scheduling. */
 	for (tmp = sd; tmp; ) {
@@ -720,9 +719,6 @@ cpu_attach_domain(struct sched_domain *sd, struct root_domain *rd, int cpu)
 			sd->child = NULL;
 	}
 
-	for (tmp = sd; tmp; tmp = tmp->parent)
-		numa_distance += !!(tmp->flags & SD_NUMA);
-
 	sched_domain_debug(sd, cpu);
 
 	rq_attach_root(rq, rd);
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [RESEND PATCH] sched/topology: Remove unused numa_distance in cpu_attach_domain()
  2021-09-15  6:31 [RESEND PATCH] sched/topology: Remove unused numa_distance in cpu_attach_domain() Yicong Yang
@ 2021-09-16  9:42 ` Barry Song
  2021-10-04 15:20 ` Valentin Schneider
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Barry Song @ 2021-09-16  9:42 UTC (permalink / raw)
  To: Yicong Yang
  Cc: mingo, Peter Zijlstra, juri.lelli, Vincent Guittot,
	valentin.schneider, LKML, Barry Song, prime.zeng

On Wed, Sep 15, 2021 at 9:55 PM Yicong Yang <yangyicong@hisilicon.com> wrote:
>
> numa_distance in cpu_attach_domain() is introduced in
> commit b5b217346de8 ("sched/topology: Warn when NUMA diameter > 2")
> to warn user when NUMA diameter > 2 as we'll misrepresent
> the scheduler topology structures at that time. This is
> fixed by Barry in commit 585b6d2723dc ("sched/topology: fix the issue
> groups don't span domain->span for NUMA diameter > 2") and
> numa_distance is unused now. So remove it.
>
> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>

I have double checked this patch and it is quite right.

When I removed the code of WARN_ON(numa_distance > 2), I forgot
to delete the numa_distance which became redundant.

Reviewed-by: Barry Song <baohua@kernel.org>

> ---
>  kernel/sched/topology.c | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
> index 4e8698e62f07..690bd1ab86f3 100644
> --- a/kernel/sched/topology.c
> +++ b/kernel/sched/topology.c
> @@ -688,7 +688,6 @@ cpu_attach_domain(struct sched_domain *sd, struct root_domain *rd, int cpu)
>  {
>         struct rq *rq = cpu_rq(cpu);
>         struct sched_domain *tmp;
> -       int numa_distance = 0;
>
>         /* Remove the sched domains which do not contribute to scheduling. */
>         for (tmp = sd; tmp; ) {
> @@ -720,9 +719,6 @@ cpu_attach_domain(struct sched_domain *sd, struct root_domain *rd, int cpu)
>                         sd->child = NULL;
>         }
>
> -       for (tmp = sd; tmp; tmp = tmp->parent)
> -               numa_distance += !!(tmp->flags & SD_NUMA);
> -
>         sched_domain_debug(sd, cpu);
>
>         rq_attach_root(rq, rd);
> --
> 2.33.0
>

Thanks
barry

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RESEND PATCH] sched/topology: Remove unused numa_distance in cpu_attach_domain()
  2021-09-15  6:31 [RESEND PATCH] sched/topology: Remove unused numa_distance in cpu_attach_domain() Yicong Yang
  2021-09-16  9:42 ` Barry Song
@ 2021-10-04 15:20 ` Valentin Schneider
  2021-10-09 10:07 ` [tip: sched/core] " tip-bot2 for Yicong Yang
  2021-10-14 11:16 ` tip-bot2 for Yicong Yang
  3 siblings, 0 replies; 5+ messages in thread
From: Valentin Schneider @ 2021-10-04 15:20 UTC (permalink / raw)
  To: Yicong Yang, mingo, peterz, juri.lelli, vincent.guittot, 21cnbao
  Cc: linux-kernel, song.bao.hua, prime.zeng, yangyicong

On 15/09/21 14:31, Yicong Yang wrote:
> numa_distance in cpu_attach_domain() is introduced in
> commit b5b217346de8 ("sched/topology: Warn when NUMA diameter > 2")
> to warn user when NUMA diameter > 2 as we'll misrepresent
> the scheduler topology structures at that time. This is
> fixed by Barry in commit 585b6d2723dc ("sched/topology: fix the issue
> groups don't span domain->span for NUMA diameter > 2") and
> numa_distance is unused now. So remove it.
>

Ah, 585b6d2723dc didn't contain a proper revert of b5b217346de8, leaving
those hunks behind.

Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [tip: sched/core] sched/topology: Remove unused numa_distance in cpu_attach_domain()
  2021-09-15  6:31 [RESEND PATCH] sched/topology: Remove unused numa_distance in cpu_attach_domain() Yicong Yang
  2021-09-16  9:42 ` Barry Song
  2021-10-04 15:20 ` Valentin Schneider
@ 2021-10-09 10:07 ` tip-bot2 for Yicong Yang
  2021-10-14 11:16 ` tip-bot2 for Yicong Yang
  3 siblings, 0 replies; 5+ messages in thread
From: tip-bot2 for Yicong Yang @ 2021-10-09 10:07 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Yicong Yang, Peter Zijlstra (Intel),
	Barry Song, Valentin Schneider, x86, linux-kernel

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     f43df9225fcad9b07a4ef4d0fe4c3ad2fb4ce82d
Gitweb:        https://git.kernel.org/tip/f43df9225fcad9b07a4ef4d0fe4c3ad2fb4ce82d
Author:        Yicong Yang <yangyicong@hisilicon.com>
AuthorDate:    Wed, 15 Sep 2021 14:31:58 +08:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Thu, 07 Oct 2021 13:51:17 +02:00

sched/topology: Remove unused numa_distance in cpu_attach_domain()

numa_distance in cpu_attach_domain() is introduced in
commit b5b217346de8 ("sched/topology: Warn when NUMA diameter > 2")
to warn user when NUMA diameter > 2 as we'll misrepresent
the scheduler topology structures at that time. This is
fixed by Barry in commit 585b6d2723dc ("sched/topology: fix the issue
groups don't span domain->span for NUMA diameter > 2") and
numa_distance is unused now. So remove it.

Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Barry Song <baohua@kernel.org>
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
Link: https://lore.kernel.org/r/20210915063158.80639-1-yangyicong@hisilicon.com
---
 kernel/sched/topology.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index c56faae..5af3edd 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -688,7 +688,6 @@ cpu_attach_domain(struct sched_domain *sd, struct root_domain *rd, int cpu)
 {
 	struct rq *rq = cpu_rq(cpu);
 	struct sched_domain *tmp;
-	int numa_distance = 0;
 
 	/* Remove the sched domains which do not contribute to scheduling. */
 	for (tmp = sd; tmp; ) {
@@ -732,9 +731,6 @@ cpu_attach_domain(struct sched_domain *sd, struct root_domain *rd, int cpu)
 		}
 	}
 
-	for (tmp = sd; tmp; tmp = tmp->parent)
-		numa_distance += !!(tmp->flags & SD_NUMA);
-
 	sched_domain_debug(sd, cpu);
 
 	rq_attach_root(rq, rd);

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [tip: sched/core] sched/topology: Remove unused numa_distance in cpu_attach_domain()
  2021-09-15  6:31 [RESEND PATCH] sched/topology: Remove unused numa_distance in cpu_attach_domain() Yicong Yang
                   ` (2 preceding siblings ...)
  2021-10-09 10:07 ` [tip: sched/core] " tip-bot2 for Yicong Yang
@ 2021-10-14 11:16 ` tip-bot2 for Yicong Yang
  3 siblings, 0 replies; 5+ messages in thread
From: tip-bot2 for Yicong Yang @ 2021-10-14 11:16 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Yicong Yang, Peter Zijlstra (Intel),
	Barry Song, Valentin Schneider, x86, linux-kernel

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     f9ec6fea201429b5a3f76319e943989f1a1e25ef
Gitweb:        https://git.kernel.org/tip/f9ec6fea201429b5a3f76319e943989f1a1e25ef
Author:        Yicong Yang <yangyicong@hisilicon.com>
AuthorDate:    Wed, 15 Sep 2021 14:31:58 +08:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Thu, 14 Oct 2021 13:09:58 +02:00

sched/topology: Remove unused numa_distance in cpu_attach_domain()

numa_distance in cpu_attach_domain() is introduced in
commit b5b217346de8 ("sched/topology: Warn when NUMA diameter > 2")
to warn user when NUMA diameter > 2 as we'll misrepresent
the scheduler topology structures at that time. This is
fixed by Barry in commit 585b6d2723dc ("sched/topology: fix the issue
groups don't span domain->span for NUMA diameter > 2") and
numa_distance is unused now. So remove it.

Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Barry Song <baohua@kernel.org>
Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
Link: https://lore.kernel.org/r/20210915063158.80639-1-yangyicong@hisilicon.com
---
 kernel/sched/topology.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index c56faae..5af3edd 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -688,7 +688,6 @@ cpu_attach_domain(struct sched_domain *sd, struct root_domain *rd, int cpu)
 {
 	struct rq *rq = cpu_rq(cpu);
 	struct sched_domain *tmp;
-	int numa_distance = 0;
 
 	/* Remove the sched domains which do not contribute to scheduling. */
 	for (tmp = sd; tmp; ) {
@@ -732,9 +731,6 @@ cpu_attach_domain(struct sched_domain *sd, struct root_domain *rd, int cpu)
 		}
 	}
 
-	for (tmp = sd; tmp; tmp = tmp->parent)
-		numa_distance += !!(tmp->flags & SD_NUMA);
-
 	sched_domain_debug(sd, cpu);
 
 	rq_attach_root(rq, rd);

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-10-14 11:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-15  6:31 [RESEND PATCH] sched/topology: Remove unused numa_distance in cpu_attach_domain() Yicong Yang
2021-09-16  9:42 ` Barry Song
2021-10-04 15:20 ` Valentin Schneider
2021-10-09 10:07 ` [tip: sched/core] " tip-bot2 for Yicong Yang
2021-10-14 11:16 ` tip-bot2 for Yicong Yang

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.