All of lore.kernel.org
 help / color / mirror / Atom feed
From: nicolas.pitre@linaro.org (Nicolas Pitre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 06/12] ARM: mcpm: change max clusters to 4
Date: Thu, 10 Apr 2014 22:39:04 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.2.11.1404102203590.980@knanqh.ubzr> (raw)
In-Reply-To: <20140410095650.GA5499@e103592.cambridge.arm.com>

On Thu, 10 Apr 2014, Dave Martin wrote:

> On Tue, Apr 08, 2014 at 04:00:46PM +0800, Haojian Zhuang wrote:
> > In order to support 4 clusters with 4 Cortex A15 Cores in each cluster,
> > enlarge maximum clusters from 2 to 4 in MCPM.
> 
> CC Nico on mcpm patches please.  I'm happy to be CC'd as well.

Indeed.

> > Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
> > ---
> >  arch/arm/include/asm/mcpm.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm/include/asm/mcpm.h b/arch/arm/include/asm/mcpm.h
> > index 608516e..68f82cf 100644
> > --- a/arch/arm/include/asm/mcpm.h
> > +++ b/arch/arm/include/asm/mcpm.h
> > @@ -20,7 +20,7 @@
> >   * to consider dynamic allocation.
> >   */
> >  #define MAX_CPUS_PER_CLUSTER	4
> > -#define MAX_NR_CLUSTERS		2
> > +#define MAX_NR_CLUSTERS		4
> 
> Because of the need for alignment to the biggest cacheline size in the
> system, the MCPM low-level locking structures consume a non-trivial
> amount of memory.
> 
> Therefore, I'm not keen on the idea of simply increasing this #define
> every time a platform appears with a larger number of clusters.
> If hip04 is not built into the kernel, this just wastes memory.
> 
> I'll leave it to Nico to decide whether we can increase the #define
> to 4 or whether this needs a proper fix now.  Ideally, we would have
> a way of choosing the maximum value required by the set of boards built
> into the kernel, or switch to dynamic allocation.

I think we should go with the ability to select a maximum based on the 
configured platforms. That could be as simple as having a 
CONFIG_MCPM_QUAD_CLUSTER symbol to be selected by those platforms that 
need it.

The memory usage is still relatively low: 4 clusters containing 6 
independent cache lines each, so for a 64-byte cache line this means 
1536 bytes.  That is rather insignificant compared to the amount of 
memory fitted to typical multi-cluster systems, especially quad cluster 
systems.  Unless there is yet more expansion of clusters and/or CPUs per 
cluster to come amongst MCPM users, I don't think we've yet reached the 
tipping point where the complexity of dynamic memory allocation for this 
is worth it.

However, changing MAX_NR_CLUSTERS cannot be done without also modifying 
the code in bL_switcher_init() or the b.L switcher won't work anymore on 
dual cluster systems as soon as a quad cluster system is configured in. 
Simply removing the test against MAX_NR_CLUSTERS should be sufficient as 
there is already a runtime validation test in bL_switcher_halve_cpus().


Nicolas

  reply	other threads:[~2014-04-11  2:39 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-08  8:00 [PATCH v2 00/12] Add Hisilicon HiP04 SoC Haojian Zhuang
2014-04-08  8:00 ` [PATCH v2 01/12] ARM: debug: add HiP04 debug uart Haojian Zhuang
2014-04-08  8:00 ` [PATCH v2 02/12] ARM: append ARCH_MULTI_V7_LPAE Haojian Zhuang
2014-04-08 10:59   ` Arnd Bergmann
2014-04-14  6:26     ` Haojian Zhuang
2014-04-08  8:00 ` [PATCH v2 03/12] ARM: hisi: add ARCH_HISI Haojian Zhuang
2014-04-08 11:02   ` Arnd Bergmann
2014-04-08 11:13   ` Arnd Bergmann
2014-04-14  7:57     ` Haojian Zhuang
2014-04-14  9:10       ` Arnd Bergmann
2014-04-08  8:00 ` [PATCH v2 04/12] irq: gic: use mask field in GICC_IAR Haojian Zhuang
2014-04-08  8:00 ` [PATCH v2 05/12] irq: gic: extends the cpu interface to 16 Haojian Zhuang
2014-04-10  8:12   ` Marc Zyngier
2014-04-08  8:00 ` [PATCH v2 06/12] ARM: mcpm: change max clusters to 4 Haojian Zhuang
2014-04-10  9:56   ` Dave Martin
2014-04-11  2:39     ` Nicolas Pitre [this message]
2014-04-11 14:57       ` Dave Martin
2014-04-15  6:45       ` Haojian Zhuang
2014-04-15  8:15         ` Dave Martin
2014-04-15 14:48         ` Nicolas Pitre
2014-04-08  8:00 ` [PATCH v2 07/12] ARM: hisi: add hip04 SoC support Haojian Zhuang
2014-04-08 11:10   ` Arnd Bergmann
2014-04-15  7:02     ` Haojian Zhuang
2014-04-15  7:50       ` Arnd Bergmann
2014-04-10  8:50   ` Mark Rutland
2014-04-15  7:35     ` Haojian Zhuang
2014-04-10 11:21   ` Dave Martin
2014-04-08  8:00 ` [PATCH v2 08/12] ARM: dts: add hip04-d01 dts file Haojian Zhuang
2014-04-10  9:09   ` Mark Rutland
2014-04-10 10:25   ` Dave Martin
2014-04-08  8:00 ` [PATCH v2 09/12] ARM: config: append hip04_defconfig Haojian Zhuang
2014-04-08 11:18   ` Arnd Bergmann
2014-04-08  8:00 ` [PATCH v2 10/12] ARM: config: select ARCH_HISI in hi3xxx_defconfig Haojian Zhuang
2014-04-08  8:00 ` [PATCH v2 11/12] ARM: hisi: enable erratum 798181 of A15 on HiP04 Haojian Zhuang
2014-04-08  8:00 ` [PATCH v2 12/12] ARM: dts: Add PMU support in HiP04 Haojian Zhuang

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=alpine.LFD.2.11.1404102203590.980@knanqh.ubzr \
    --to=nicolas.pitre@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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.