[PATCH 4/4] powerpc/smp: Add Power9 scheduler topology

Michael Ellerman mpe at ellerman.id.au
Thu Aug 31 17:30:15 AEST 2017


Oliver O'Halloran <oohall at gmail.com> writes:

> diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
> index 46f071cedf31..7b2ed0d6fc96 100644
> --- a/arch/powerpc/kernel/smp.c
> +++ b/arch/powerpc/kernel/smp.c
> @@ -1043,7 +1081,19 @@ void __init smp_cpus_done(unsigned int max_cpus)
>  
>  	dump_numa_cpu_topology();
>  
> -	set_sched_topology(powerpc_topology);
> +	/*
> +	 * If any CPU detects that it's sharing a cache with another CPU then
> +	 * use the deeper topology that is aware of this sharing.
> +	 */
> +	if (shared_caches) {
> +		pr_info("Using shared cache scheduler topology\n");
> +		set_sched_topology(power9_topology);
> +		/* HACK: warn if we're using this on anything by P9 */
> +		WARN_ON((mfspr(SPRN_PVR) & 0xffffff00) != 0x004e0100);

Um, yuck.

Why are we doing that?

cheers


More information about the Linuxppc-dev mailing list