Re: [PATCH 04/11] powerpc/smp: Enable small core scheduling sooner

2020-07-20 Thread Srikar Dronamraju
* Jordan Niethe  [2020-07-20 17:47:27]:

> On Tue, Jul 14, 2020 at 2:44 PM Srikar Dronamraju
>  wrote:
> >
> > Enable small core scheduling as soon as we detect that we are in a
> > system that supports thread group. Doing so would avoid a redundant
> > check.
> >
> > Cc: linuxppc-dev 
> > Cc: Michael Ellerman 
> > Cc: Nick Piggin 
> > Cc: Oliver OHalloran 
> > Cc: Nathan Lynch 
> > Cc: Michael Neuling 
> > Cc: Anton Blanchard 
> > Cc: Gautham R Shenoy 
> > Cc: Vaidyanathan Srinivasan 
> > Signed-off-by: Srikar Dronamraju 
> > ---
> >  arch/powerpc/kernel/smp.c | 12 ++--
> >  1 file changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
> > index 24529f6134aa..7d430fc536cc 100644
> > --- a/arch/powerpc/kernel/smp.c
> > +++ b/arch/powerpc/kernel/smp.c
> > @@ -892,6 +892,12 @@ static int init_big_cores(void)
> > }
> >
> > has_big_cores = true;
> > +
> > +#ifdef CONFIG_SCHED_SMT
> > +   pr_info("Big cores detected. Using small core scheduling\n");
> Why change the wording from "Big cores detected but using small core
> scheduling\n"?
> > +   powerpc_topology[0].mask = smallcore_smt_mask;
> > +#endif
> > +

To me, "but" in the message sounded as if we detected Big cores *but* we want
to continue using smallcore scheduling. However the code was always meaning
to say, "Since we detected big core, i.e thread grouping within a core, System 
would
benefit by using small core scheduling".

If you think, "but" was adding more info and not misleading, then I can add it 
back.

> > return 0;
> >  }
> >

-- 
Thanks and Regards
Srikar Dronamraju


Re: [PATCH 04/11] powerpc/smp: Enable small core scheduling sooner

2020-07-20 Thread Jordan Niethe
On Tue, Jul 14, 2020 at 2:44 PM Srikar Dronamraju
 wrote:
>
> Enable small core scheduling as soon as we detect that we are in a
> system that supports thread group. Doing so would avoid a redundant
> check.
>
> Cc: linuxppc-dev 
> Cc: Michael Ellerman 
> Cc: Nick Piggin 
> Cc: Oliver OHalloran 
> Cc: Nathan Lynch 
> Cc: Michael Neuling 
> Cc: Anton Blanchard 
> Cc: Gautham R Shenoy 
> Cc: Vaidyanathan Srinivasan 
> Signed-off-by: Srikar Dronamraju 
> ---
>  arch/powerpc/kernel/smp.c | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
> index 24529f6134aa..7d430fc536cc 100644
> --- a/arch/powerpc/kernel/smp.c
> +++ b/arch/powerpc/kernel/smp.c
> @@ -892,6 +892,12 @@ static int init_big_cores(void)
> }
>
> has_big_cores = true;
> +
> +#ifdef CONFIG_SCHED_SMT
> +   pr_info("Big cores detected. Using small core scheduling\n");
Why change the wording from "Big cores detected but using small core
scheduling\n"?
> +   powerpc_topology[0].mask = smallcore_smt_mask;
> +#endif
> +
> return 0;
>  }
>
> @@ -1383,12 +1389,6 @@ void __init smp_cpus_done(unsigned int max_cpus)
>
> dump_numa_cpu_topology();
>
> -#ifdef CONFIG_SCHED_SMT
> -   if (has_big_cores) {
> -   pr_info("Big cores detected but using small core 
> scheduling\n");
> -   powerpc_topology[0].mask = smallcore_smt_mask;
> -   }
> -#endif
> set_sched_topology(powerpc_topology);
>  }
>
> --
> 2.17.1
>


Re: [PATCH 04/11] powerpc/smp: Enable small core scheduling sooner

2020-07-20 Thread Srikar Dronamraju
* Gautham R Shenoy  [2020-07-17 11:18:21]:

> On Tue, Jul 14, 2020 at 10:06:17AM +0530, Srikar Dronamraju wrote:
> > Enable small core scheduling as soon as we detect that we are in a
> > system that supports thread group. Doing so would avoid a redundant
> > check.
> > 
> > Cc: linuxppc-dev 
> > Cc: Michael Ellerman 
> > Cc: Nick Piggin 
> > Cc: Oliver OHalloran 
> > Cc: Nathan Lynch 
> > Cc: Michael Neuling 
> > Cc: Anton Blanchard 
> > Cc: Gautham R Shenoy 
> > Cc: Vaidyanathan Srinivasan 
> > Signed-off-by: Srikar Dronamraju 
> 
> I don't see a problem with this.
> 
> However, since we are now going to be maintaining a single topology
> structure, wouldn't it be better to collate all the changes being made
> to the mask_functions/flags/names of this structure within a single
> function so that it becomes easier to keep track of what all changes
> are going into the topology and why are we doing it?
> 

My intent was to move the topology updates early as soon as they are
detected. Currently the shared_cache want cannot be detected early. 
But I think its possible to detect shared_cache early with some cleanups.
And if we do, then we should be able to call this up pretty early.

> 
> > ---
> >  arch/powerpc/kernel/smp.c | 12 ++--
> >  1 file changed, 6 insertions(+), 6 deletions(-)
> > 
> > diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
> > index 24529f6134aa..7d430fc536cc 100644
> > --- a/arch/powerpc/kernel/smp.c
> > +++ b/arch/powerpc/kernel/smp.c
> > @@ -892,6 +892,12 @@ static int init_big_cores(void)
> > }
> > 
> > has_big_cores = true;
> > +
> > +#ifdef CONFIG_SCHED_SMT
> > +   pr_info("Big cores detected. Using small core scheduling\n");
> > +   powerpc_topology[0].mask = smallcore_smt_mask;
> > +#endif
> > +
> > return 0;
> >  }
> > 
> > @@ -1383,12 +1389,6 @@ void __init smp_cpus_done(unsigned int max_cpus)
> > 
> > dump_numa_cpu_topology();
> > 
> > -#ifdef CONFIG_SCHED_SMT
> > -   if (has_big_cores) {
> > -   pr_info("Big cores detected but using small core scheduling\n");
> > -   powerpc_topology[0].mask = smallcore_smt_mask;
> > -   }
> > -#endif
> > set_sched_topology(powerpc_topology);
> >  }
> > 
> > -- 
> > 2.17.1
> > 

-- 
Thanks and Regards
Srikar Dronamraju


Re: [PATCH 04/11] powerpc/smp: Enable small core scheduling sooner

2020-07-16 Thread Gautham R Shenoy
On Tue, Jul 14, 2020 at 10:06:17AM +0530, Srikar Dronamraju wrote:
> Enable small core scheduling as soon as we detect that we are in a
> system that supports thread group. Doing so would avoid a redundant
> check.
> 
> Cc: linuxppc-dev 
> Cc: Michael Ellerman 
> Cc: Nick Piggin 
> Cc: Oliver OHalloran 
> Cc: Nathan Lynch 
> Cc: Michael Neuling 
> Cc: Anton Blanchard 
> Cc: Gautham R Shenoy 
> Cc: Vaidyanathan Srinivasan 
> Signed-off-by: Srikar Dronamraju 

I don't see a problem with this.

However, since we are now going to be maintaining a single topology
structure, wouldn't it be better to collate all the changes being made
to the mask_functions/flags/names of this structure within a single
function so that it becomes easier to keep track of what all changes
are going into the topology and why are we doing it?


> ---
>  arch/powerpc/kernel/smp.c | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
> index 24529f6134aa..7d430fc536cc 100644
> --- a/arch/powerpc/kernel/smp.c
> +++ b/arch/powerpc/kernel/smp.c
> @@ -892,6 +892,12 @@ static int init_big_cores(void)
>   }
> 
>   has_big_cores = true;
> +
> +#ifdef CONFIG_SCHED_SMT
> + pr_info("Big cores detected. Using small core scheduling\n");
> + powerpc_topology[0].mask = smallcore_smt_mask;
> +#endif
> +
>   return 0;
>  }
> 
> @@ -1383,12 +1389,6 @@ void __init smp_cpus_done(unsigned int max_cpus)
> 
>   dump_numa_cpu_topology();
> 
> -#ifdef CONFIG_SCHED_SMT
> - if (has_big_cores) {
> - pr_info("Big cores detected but using small core scheduling\n");
> - powerpc_topology[0].mask = smallcore_smt_mask;
> - }
> -#endif
>   set_sched_topology(powerpc_topology);
>  }
> 
> -- 
> 2.17.1
> 


[PATCH 04/11] powerpc/smp: Enable small core scheduling sooner

2020-07-13 Thread Srikar Dronamraju
Enable small core scheduling as soon as we detect that we are in a
system that supports thread group. Doing so would avoid a redundant
check.

Cc: linuxppc-dev 
Cc: Michael Ellerman 
Cc: Nick Piggin 
Cc: Oliver OHalloran 
Cc: Nathan Lynch 
Cc: Michael Neuling 
Cc: Anton Blanchard 
Cc: Gautham R Shenoy 
Cc: Vaidyanathan Srinivasan 
Signed-off-by: Srikar Dronamraju 
---
 arch/powerpc/kernel/smp.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 24529f6134aa..7d430fc536cc 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -892,6 +892,12 @@ static int init_big_cores(void)
}
 
has_big_cores = true;
+
+#ifdef CONFIG_SCHED_SMT
+   pr_info("Big cores detected. Using small core scheduling\n");
+   powerpc_topology[0].mask = smallcore_smt_mask;
+#endif
+
return 0;
 }
 
@@ -1383,12 +1389,6 @@ void __init smp_cpus_done(unsigned int max_cpus)
 
dump_numa_cpu_topology();
 
-#ifdef CONFIG_SCHED_SMT
-   if (has_big_cores) {
-   pr_info("Big cores detected but using small core scheduling\n");
-   powerpc_topology[0].mask = smallcore_smt_mask;
-   }
-#endif
set_sched_topology(powerpc_topology);
 }
 
-- 
2.17.1