linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Morse <james.morse@arm.com>
To: linux-kernel@vger.kernel.org
Cc: x86@kernel.org, Thomas Gleixner <tglx@linutronix.de>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Tony Luck <tony.luck@intel.com>, Ingo Molnar <mingo@redhat.com>,
	H Peter Anvin <hpa@zytor.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Vikas Shivappa <vikas.shivappa@linux.intel.com>
Subject: [RFC PATCH 19/20] x86/intel_rdt: Kill off alloc_enabled
Date: Fri, 24 Aug 2018 11:45:18 +0100	[thread overview]
Message-ID: <20180824104519.11203-20-james.morse@arm.com> (raw)
In-Reply-To: <20180824104519.11203-1-james.morse@arm.com>

Now that the L2/L2CODE/L2DATA resources are merged together, alloc_enabled
doesn't mean anything, its the same as alloc_capable which indicates
CAT is supported by this cache.

Take the opportunity to kill of alloc_enabled and its helpers.

Signed-off-by: James Morse <james.morse@arm.com>
---
 arch/x86/kernel/cpu/intel_rdt.c             | 3 ---
 arch/x86/kernel/cpu/intel_rdt.h             | 5 -----
 arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c | 2 +-
 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c    | 6 +++---
 include/linux/resctrl.h                     | 2 --
 5 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/arch/x86/kernel/cpu/intel_rdt.c b/arch/x86/kernel/cpu/intel_rdt.c
index f6f1eceb366f..982897839711 100644
--- a/arch/x86/kernel/cpu/intel_rdt.c
+++ b/arch/x86/kernel/cpu/intel_rdt.c
@@ -157,7 +157,6 @@ static inline void cache_alloc_hsw_probe(void)
 	r->cache.shareable_bits = 0xc0000;
 	r->cache.min_cbm_bits = 2;
 	r->alloc_capable = true;
-	r->alloc_enabled = true;
 
 	rdt_alloc_capable = true;
 }
@@ -214,7 +213,6 @@ static bool rdt_get_mem_config(struct rdt_resource *r)
 	r->data_width = 3;
 
 	r->alloc_capable = true;
-	r->alloc_enabled = true;
 
 	return true;
 }
@@ -234,7 +232,6 @@ static void rdt_get_cache_alloc_cfg(int idx, struct rdt_resource *r)
 	r->cache.shareable_bits = ebx & r->default_ctrl;
 	r->data_width = (r->cache.cbm_len + 3) / 4;
 	r->alloc_capable = true;
-	r->alloc_enabled = true;
 }
 
 static int get_cache_id(int cpu, int level)
diff --git a/arch/x86/kernel/cpu/intel_rdt.h b/arch/x86/kernel/cpu/intel_rdt.h
index a4aba005cfea..735d7bd4bcd9 100644
--- a/arch/x86/kernel/cpu/intel_rdt.h
+++ b/arch/x86/kernel/cpu/intel_rdt.h
@@ -342,11 +342,6 @@ static inline struct rdt_resource *resctrl_inc(struct rdt_resource *res)
 	     r = resctrl_inc(r))							\
 		if (r->mon_capable)
 
-#define for_each_alloc_enabled_rdt_resource(r)				      \
-	for (r = &rdt_resources_all[0].resctrl; r < &rdt_resources_all[RDT_NUM_RESOURCES].resctrl;\
-	     r = resctrl_inc(r))							\
-		if (r->alloc_enabled)
-
 #define for_each_mon_enabled_rdt_resource(r)				      \
 	for (r = &rdt_resources_all[0].resctrl; r < &rdt_resources_all[RDT_NUM_RESOURCES].resctrl;\
 	     r = resctrl_inc(r))						\
diff --git a/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c b/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c
index e8264637a4d3..ab8bc97dee0b 100644
--- a/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c
+++ b/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c
@@ -329,7 +329,7 @@ ssize_t rdtgroup_schemata_write(struct kernfs_open_file *of,
 			goto out;
 	}
 
-	for_each_alloc_enabled_rdt_resource(r) {
+	for_each_alloc_capable_rdt_resource(r) {
 		ret = resctrl_arch_update_domains(r);
 		if (ret)
 			goto out;
diff --git a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
index 39038bdfa7d6..38cd463443e8 100644
--- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
+++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
@@ -103,7 +103,7 @@ static void closid_init(void)
 	int rdt_min_closid = 32;
 
 	/* Compute rdt_min_closid across all resources */
-	for_each_alloc_enabled_rdt_resource(r)
+	for_each_alloc_capable_rdt_resource(r)
 		rdt_min_closid = min(rdt_min_closid, r->num_closid);
 
 	closid_free_map = BIT_MASK(rdt_min_closid) - 1;
@@ -1307,7 +1307,7 @@ static int create_schemata_list(void)
 	int ret = 0;
 	struct rdt_resource *r;
 
-	for_each_alloc_enabled_rdt_resource(r) {
+	for_each_alloc_capable_rdt_resource(r) {
 		if (r->cdp_enabled) {
 			ret = add_schema(CDP_CODE, r);
 			ret |= add_schema(CDP_DATA, r);
@@ -1586,7 +1586,7 @@ static void rdt_kill_sb(struct super_block *sb)
 	set_mba_sc(false);
 
 	/*Put everything back to default values. */
-	for_each_alloc_enabled_rdt_resource(r)
+	for_each_capable_rdt_resource(r)
 		reset_all_ctrls(r);
 	cdp_disable_all();
 	rmdir_all_sub();
diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h
index 8b06ed8e7407..7a955ce93988 100644
--- a/include/linux/resctrl.h
+++ b/include/linux/resctrl.h
@@ -86,7 +86,6 @@ struct resctrl_membw {
 };
 
 /**
- * @alloc_enabled:	Is allocation enabled on this machine
  * @mon_enabled:	Is monitoring enabled for this feature
  * @cdp_enabled		Is CDP enabled for this resource
  * @alloc_capable:	Is allocation available on this machine
@@ -113,7 +112,6 @@ struct resctrl_membw {
  * @fflags:		flags to choose base and info files
  */
 struct rdt_resource {
-	bool				alloc_enabled;
 	bool				mon_enabled;
 	bool				cdp_enabled;
 	bool				alloc_capable;
-- 
2.18.0


  parent reply	other threads:[~2018-08-24 10:46 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-24 10:44 [RFC PATCH 00/20] x86/intel_rdt: Start abstraction for a second arch James Morse
2018-08-24 10:45 ` [RFC PATCH 01/20] x86/intel_rdt: Split struct rdt_resource James Morse
2018-08-24 10:45 ` [RFC PATCH 02/20] x86/intel_rdt: Split struct rdt_domain James Morse
2018-08-24 10:45 ` [RFC PATCH 03/20] x86/intel_rdt: Group staged configuration into a separate struct James Morse
2018-08-24 10:45 ` [RFC PATCH 04/20] x86/intel_rdt: Add closid to the staged config James Morse
2018-08-24 10:45 ` [RFC PATCH 05/20] x86/intel_rdt: make update_domains() learn the affected closids James Morse
2018-08-24 10:45 ` [RFC PATCH 06/20] x86/intel_rdt: Add a helper to read a closid's configuration for show_doms() James Morse
2018-08-24 10:45 ` [RFC PATCH 07/20] x86/intel_rdt: Expose update_domains() as an arch helper James Morse
2018-08-24 10:45 ` [RFC PATCH 08/20] x86/intel_rdt: Make cdp enable/disable global James Morse
2018-08-24 10:45 ` [RFC PATCH 09/20] x86/intel_rdt: Track the actual number of closids separately James Morse
2018-08-24 10:45 ` [RFC PATCH 10/20] x86/intel_rdt: Let resctrl change the resources's num_closid James Morse
2018-08-24 10:45 ` [RFC PATCH 11/20] x86/intel_rdt: Pass in the code/data/both configuration value when parsing James Morse
2018-08-24 10:45 ` [RFC PATCH 12/20] x86/intel_rdt: Correct the closid when staging configuration changes James Morse
2018-08-24 10:45 ` [RFC PATCH 13/20] x86/intel_rdt: Allow different CODE/DATA configurations to be staged James Morse
2018-08-24 10:45 ` [RFC PATCH 14/20] x86/intel_rdt: Add a separate resource list for resctrl James Morse
2018-08-24 10:45 ` [RFC PATCH 15/20] x86/intel_rdt: Walk the resctrl schema list instead of the arch's resource list James Morse
2018-08-24 10:45 ` [RFC PATCH 16/20] x86/intel_rdt: Move the schemata names into struct resctrl_schema James Morse
2018-08-24 10:45 ` [RFC PATCH 17/20] x86/intel_rdt: Stop using Lx CODE/DATA resources James Morse
2018-08-24 10:45 ` [RFC PATCH 18/20] x86/intel_rdt: Remove the CODE/DATA illusionary caches James Morse
2018-08-24 10:45 ` James Morse [this message]
2018-08-24 10:45 ` [RFC PATCH 20/20] x86/intel_rdt: Merge cdp enable/disable calls James Morse
2018-08-27 14:22 ` [RFC PATCH 00/20] x86/intel_rdt: Start abstraction for a second arch Fenghua Yu
2018-08-31 15:34   ` James Morse
2018-09-06 14:03     ` Thomas Gleixner
2018-11-27 12:33 ` Yury Norov
2018-11-30 19:23   ` James Morse

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=20180824104519.11203-20-james.morse@arm.com \
    --to=james.morse@arm.com \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=reinette.chatre@intel.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=vikas.shivappa@linux.intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).