All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Hans Rosenfeld <hans.rosenfeld@amd.com>
Cc: hpa@zytor.com, tglx@linutronix.de, Andreas.Herrmann3@amd.com,
	linux-kernel@vger.kernel.org, x86@kernel.org
Subject: Re: [PATCH 4/4] x86, amd: Support L3 Cache Partitioning on AMD family 0x15 CPUs
Date: Wed, 26 Jan 2011 21:56:08 +0100	[thread overview]
Message-ID: <20110126205608.GA14361@elte.hu> (raw)
In-Reply-To: <1296061716-185599-1-git-send-email-hans.rosenfeld@amd.com>


* Hans Rosenfeld <hans.rosenfeld@amd.com> wrote:

> L3 Cache Partitioning allows selecting which of the 4 L3 subcaches can
> be used for evictions by the L2 cache of each compute unit. By writing a
> 4-bit hexadecimal mask into the the sysfs file /sys/devices/system/cpu/\
> cpuX/cache/index3/subcaches, the user can set the enabled subcaches for
> a CPU. The settings are directly read from and written to the hardware,
> so there is no way to have contradicting settings for two CPUs belonging
> to the same compute unit. Writing will always overwrite any previous
> setting for a compute unit.
> 
> Signed-off-by: Hans Rosenfeld <hans.rosenfeld@amd.com>
> ---
>  arch/x86/include/asm/amd_nb.h         |    3 +
>  arch/x86/kernel/amd_nb.c              |   57 ++++++++++++++++++++++++
>  arch/x86/kernel/cpu/intel_cacheinfo.c |   77 +++++++++++++++++++++++++++-----
>  3 files changed, 125 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/x86/include/asm/amd_nb.h b/arch/x86/include/asm/amd_nb.h
> index 3e70700..423f11c 100644
> --- a/arch/x86/include/asm/amd_nb.h
> +++ b/arch/x86/include/asm/amd_nb.h
> @@ -18,6 +18,8 @@ extern int amd_cache_northbridges(void);
>  extern void amd_flush_garts(void);
>  extern int amd_numa_init(unsigned long start_pfn, unsigned long end_pfn);
>  extern int amd_scan_nodes(void);
> +extern int amd_get_subcaches(int);
> +extern int amd_set_subcaches(int, int);
>  
>  #ifdef CONFIG_NUMA_EMU
>  extern void amd_fake_nodes(const struct bootnode *nodes, int nr_nodes);
> @@ -38,6 +40,7 @@ extern struct amd_northbridge_info amd_northbridges;
>  
>  #define AMD_NB_GART			0x1
>  #define AMD_NB_L3_INDEX_DISABLE		0x2
> +#define AMD_NB_L3_PARTITIONING		0x4
>  
>  #ifdef CONFIG_AMD_NB
>  
> diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c
> index 4ae9a96..63310de 100644
> --- a/arch/x86/kernel/amd_nb.c
> +++ b/arch/x86/kernel/amd_nb.c
> @@ -95,6 +95,10 @@ int amd_cache_northbridges(void)
>  	if (boot_cpu_data.x86 == 0x15)
>  		amd_northbridges.flags |= AMD_NB_L3_INDEX_DISABLE;
>  
> +	/* L3 cache partitioning is supported on family 0x15 */
> +	if (boot_cpu_data.x86 == 0x15)
> +		amd_northbridges.flags |= AMD_NB_L3_PARTITIONING;
> +
>  	return 0;
>  }
>  EXPORT_SYMBOL_GPL(amd_cache_northbridges);
> @@ -112,6 +116,59 @@ int __init early_is_amd_nb(u32 device)
>  	return 0;
>  }
>  
> +#ifdef CONFIG_SMP
> +int amd_get_subcaches(int cpu)

Well, sprinkling it with CONFIG_SMP is pretty ugly. Also, there's no fundamental 
reason why this shouldnt work with UP. Yes, it makes most sense on SMP but such code 
should be SMP-invariant.

Thanks,

	Ingo

  reply	other threads:[~2011-01-26 20:56 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-24 15:05 [PATCH 0/4] x86, amd: family 0x15 L3 cache features Hans Rosenfeld
2011-01-24 15:05 ` [PATCH 1/4] x86, amd: Normalize compute unit IDs on multi-node processors Hans Rosenfeld
2011-01-26 10:57   ` [tip:x86/amd-nb] " tip-bot for Andreas Herrmann
2011-02-14 14:30     ` Ingo Molnar
2011-02-14 17:14       ` [PATCH] x86, amd: Fix uninitialized variable warning Borislav Petkov
2011-02-15  3:10         ` [tip:x86/amd-nb] x86, amd: Initialize variable properly tip-bot for Borislav Petkov
2011-02-04 22:07   ` [PATCH 1/4] x86, amd: Normalize compute unit IDs on multi-node processors Andrew Morton
2011-01-24 15:05 ` [PATCH 2/4] x86, amd: Enable L3 cache index disable on family 0x15 Hans Rosenfeld
2011-01-26 10:58   ` [tip:x86/amd-nb] " tip-bot for Hans Rosenfeld
2011-01-24 15:05 ` [PATCH 3/4] x86, amd: Extend AMD northbridge caching code to support "Link Control" devices Hans Rosenfeld
2011-01-26 10:58   ` [tip:x86/amd-nb] " tip-bot for Hans Rosenfeld
2011-01-24 15:05 ` [PATCH 4/4] x86, amd: Support L3 Cache Partitioning on AMD family 0x15 CPUs Hans Rosenfeld
2011-01-26 10:56   ` Ingo Molnar
2011-01-26 17:05     ` Hans Rosenfeld
2011-01-26 17:08     ` Hans Rosenfeld
2011-01-26 20:56       ` Ingo Molnar [this message]
2011-01-27 11:50         ` Hans Rosenfeld
2011-01-27 12:47           ` Ingo Molnar
2011-02-01 15:14             ` Hans Rosenfeld
2011-02-07 17:10             ` Hans Rosenfeld
2011-02-08 12:03               ` [tip:x86/amd-nb] " tip-bot for Hans Rosenfeld
  -- strict thread matches above, loose matches on Subject: below --
2010-12-20 17:13 [PATCH 0/4] x86, amd: family 0x15 L3 cache features Hans Rosenfeld
2010-12-20 17:13 ` [PATCH 4/4] x86, amd: Support L3 Cache Partitioning on AMD family 0x15 CPUs Hans Rosenfeld

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=20110126205608.GA14361@elte.hu \
    --to=mingo@elte.hu \
    --cc=Andreas.Herrmann3@amd.com \
    --cc=hans.rosenfeld@amd.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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.