diff mbox

[v5,06/14] ARM: mcpm: support 4 clusters

Message ID 1399473888-12947-7-git-send-email-haojian.zhuang@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Haojian Zhuang May 7, 2014, 2:44 p.m. UTC
Add the CONFIG_MCPM_QUAD_CLUSTER configuration to enlarge cluster number
from 2 to 4.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
---
 arch/arm/Kconfig            | 9 +++++++++
 arch/arm/include/asm/mcpm.h | 5 +++++
 2 files changed, 14 insertions(+)

Comments

Olof Johansson May 7, 2014, 4:48 p.m. UTC | #1
On Wed, May 07, 2014 at 10:44:40PM +0800, Haojian Zhuang wrote:
> Add the CONFIG_MCPM_QUAD_CLUSTER configuration to enlarge cluster number
> from 2 to 4.
> 
> Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
> ---
>  arch/arm/Kconfig            | 9 +++++++++
>  arch/arm/include/asm/mcpm.h | 5 +++++
>  2 files changed, 14 insertions(+)
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 0e52a2c..624829f 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -1575,6 +1575,15 @@ config MCPM
>  	  for (multi-)cluster based systems, such as big.LITTLE based
>  	  systems.
>  
> +config MCPM_QUAD_CLUSTER
> +	bool "Enable Quad clusters in MCPM"
> +	depends on MCPM
> +	help
> +	  To avoid wasting resources unnecessarily, MCPM only supports up
> +	  to 2 clusters by default.
> +	  Platforms with 3 or 4 clusters that use MCPM must select this
> +	  option to allow the additional clusters to be managed.
> +

Why don't you add an integer config instead, i.e. MCPM_MAX_CLUSTERS, and let
that set MAX_NR_CLUSTERS?


-Olof
Nicolas Pitre May 7, 2014, 4:59 p.m. UTC | #2
On Wed, 7 May 2014, Haojian Zhuang wrote:

> Add the CONFIG_MCPM_QUAD_CLUSTER configuration to enlarge cluster number
> from 2 to 4.
> 
> Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
> ---
>  arch/arm/Kconfig            | 9 +++++++++
>  arch/arm/include/asm/mcpm.h | 5 +++++
>  2 files changed, 14 insertions(+)
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 0e52a2c..624829f 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -1575,6 +1575,15 @@ config MCPM
>  	  for (multi-)cluster based systems, such as big.LITTLE based
>  	  systems.
>  
> +config MCPM_QUAD_CLUSTER
> +	bool "Enable Quad clusters in MCPM"

Please remove the prompt string, keeping only the bool alone.  This 
config option shouldn't be visible to users.  After that you may add:

Reviewed-by: Nicolas Pitre <nico@linaro.org>


> +	depends on MCPM
> +	help
> +	  To avoid wasting resources unnecessarily, MCPM only supports up
> +	  to 2 clusters by default.
> +	  Platforms with 3 or 4 clusters that use MCPM must select this
> +	  option to allow the additional clusters to be managed.
> +
>  config BIG_LITTLE
>  	bool "big.LITTLE support (Experimental)"
>  	depends on CPU_V7 && SMP
> diff --git a/arch/arm/include/asm/mcpm.h b/arch/arm/include/asm/mcpm.h
> index 608516e..fc8d70d 100644
> --- a/arch/arm/include/asm/mcpm.h
> +++ b/arch/arm/include/asm/mcpm.h
> @@ -20,7 +20,12 @@
>   * to consider dynamic allocation.
>   */
>  #define MAX_CPUS_PER_CLUSTER	4
> +
> +#ifdef CONFIG_MCPM_QUAD_CLUSTER
> +#define MAX_NR_CLUSTERS		4
> +#else
>  #define MAX_NR_CLUSTERS		2
> +#endif
>  
>  #ifndef __ASSEMBLY__
>  
> -- 
> 1.9.1
>
Nicolas Pitre May 7, 2014, 6 p.m. UTC | #3
On Wed, 7 May 2014, Olof Johansson wrote:

> On Wed, May 07, 2014 at 10:44:40PM +0800, Haojian Zhuang wrote:
> > Add the CONFIG_MCPM_QUAD_CLUSTER configuration to enlarge cluster number
> > from 2 to 4.
> > 
> > Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
> > ---
> >  arch/arm/Kconfig            | 9 +++++++++
> >  arch/arm/include/asm/mcpm.h | 5 +++++
> >  2 files changed, 14 insertions(+)
> > 
> > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > index 0e52a2c..624829f 100644
> > --- a/arch/arm/Kconfig
> > +++ b/arch/arm/Kconfig
> > @@ -1575,6 +1575,15 @@ config MCPM
> >  	  for (multi-)cluster based systems, such as big.LITTLE based
> >  	  systems.
> >  
> > +config MCPM_QUAD_CLUSTER
> > +	bool "Enable Quad clusters in MCPM"
> > +	depends on MCPM
> > +	help
> > +	  To avoid wasting resources unnecessarily, MCPM only supports up
> > +	  to 2 clusters by default.
> > +	  Platforms with 3 or 4 clusters that use MCPM must select this
> > +	  option to allow the additional clusters to be managed.
> > +
> 
> Why don't you add an integer config instead, i.e. MCPM_MAX_CLUSTERS, and let
> that set MAX_NR_CLUSTERS?

I requested for this config symbol not to be visible to users (the 
prompt string should be removed) and be selected by those platforms that 
need it instead.  And there is no way to specify an actual value with 
'select'. And that wouldn't work in a multi-platform config where 
different platforms could fight over a different value anyway.

I also prefer to keep some control on the actual number that can be used 
here so not to let people go overboard with it.  If this grows too big 
we'll have to consider some dynamic allocation instead.

See previous discussion here:

http://article.gmane.org/gmane.linux.ports.arm.kernel/315228


Nicolas
Olof Johansson May 7, 2014, 6:03 p.m. UTC | #4
On Wed, May 7, 2014 at 11:00 AM, Nicolas Pitre <nicolas.pitre@linaro.org> wrote:
> On Wed, 7 May 2014, Olof Johansson wrote:
>
>> On Wed, May 07, 2014 at 10:44:40PM +0800, Haojian Zhuang wrote:
>> > Add the CONFIG_MCPM_QUAD_CLUSTER configuration to enlarge cluster number
>> > from 2 to 4.
>> >
>> > Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
>> > ---
>> >  arch/arm/Kconfig            | 9 +++++++++
>> >  arch/arm/include/asm/mcpm.h | 5 +++++
>> >  2 files changed, 14 insertions(+)
>> >
>> > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>> > index 0e52a2c..624829f 100644
>> > --- a/arch/arm/Kconfig
>> > +++ b/arch/arm/Kconfig
>> > @@ -1575,6 +1575,15 @@ config MCPM
>> >       for (multi-)cluster based systems, such as big.LITTLE based
>> >       systems.
>> >
>> > +config MCPM_QUAD_CLUSTER
>> > +   bool "Enable Quad clusters in MCPM"
>> > +   depends on MCPM
>> > +   help
>> > +     To avoid wasting resources unnecessarily, MCPM only supports up
>> > +     to 2 clusters by default.
>> > +     Platforms with 3 or 4 clusters that use MCPM must select this
>> > +     option to allow the additional clusters to be managed.
>> > +
>>
>> Why don't you add an integer config instead, i.e. MCPM_MAX_CLUSTERS, and let
>> that set MAX_NR_CLUSTERS?
>
> I requested for this config symbol not to be visible to users (the
> prompt string should be removed) and be selected by those platforms that
> need it instead.  And there is no way to specify an actual value with
> 'select'. And that wouldn't work in a multi-platform config where
> different platforms could fight over a different value anyway.
>
> I also prefer to keep some control on the actual number that can be used
> here so not to let people go overboard with it.  If this grows too big
> we'll have to consider some dynamic allocation instead.
>
> See previous discussion here:
>
> http://article.gmane.org/gmane.linux.ports.arm.kernel/315228

Ok, fair enough.


-Olof
diff mbox

Patch

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 0e52a2c..624829f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1575,6 +1575,15 @@  config MCPM
 	  for (multi-)cluster based systems, such as big.LITTLE based
 	  systems.
 
+config MCPM_QUAD_CLUSTER
+	bool "Enable Quad clusters in MCPM"
+	depends on MCPM
+	help
+	  To avoid wasting resources unnecessarily, MCPM only supports up
+	  to 2 clusters by default.
+	  Platforms with 3 or 4 clusters that use MCPM must select this
+	  option to allow the additional clusters to be managed.
+
 config BIG_LITTLE
 	bool "big.LITTLE support (Experimental)"
 	depends on CPU_V7 && SMP
diff --git a/arch/arm/include/asm/mcpm.h b/arch/arm/include/asm/mcpm.h
index 608516e..fc8d70d 100644
--- a/arch/arm/include/asm/mcpm.h
+++ b/arch/arm/include/asm/mcpm.h
@@ -20,7 +20,12 @@ 
  * to consider dynamic allocation.
  */
 #define MAX_CPUS_PER_CLUSTER	4
+
+#ifdef CONFIG_MCPM_QUAD_CLUSTER
+#define MAX_NR_CLUSTERS		4
+#else
 #define MAX_NR_CLUSTERS		2
+#endif
 
 #ifndef __ASSEMBLY__