linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/intel_rdt: reinitialize cbm for new group allocation
@ 2017-01-07  0:05 Shaohua Li
  2017-01-09 21:56 ` Fenghua Yu
  2017-01-09 21:58 ` Thomas Gleixner
  0 siblings, 2 replies; 6+ messages in thread
From: Shaohua Li @ 2017-01-07  0:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: Fenghua Yu, Thomas Gleixner

rdtgroup_rmdir deletes a group and frees the closid, but doesn't
reiniaialize domain's cbm to default for the closid. Next time the
closid is allocated again, 'schemata' will show old cbm. We can do the
reinitialization at free/alloc closid, but sounds doing it at alloc is
more nartual.

Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Shaohua Li <shli@fb.com>
---
 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
index 8af04af..7e81527 100644
--- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
+++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
@@ -78,12 +78,21 @@ static void closid_init(void)
 int closid_alloc(void)
 {
 	int closid = ffs(closid_free_map);
+	struct rdt_resource *r;
+	struct rdt_domain *dom;
 
 	if (closid == 0)
 		return -ENOSPC;
 	closid--;
 	closid_free_map &= ~(1 << closid);
 
+	for_each_enabled_rdt_resource(r) {
+		if (closid >= r->num_closid)
+			continue;
+		list_for_each_entry(dom, &r->domains, list)
+			dom->cbm[closid] = r->max_cbm;
+	}
+
 	return closid;
 }
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-01-09 22:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-07  0:05 [PATCH] x86/intel_rdt: reinitialize cbm for new group allocation Shaohua Li
2017-01-09 21:56 ` Fenghua Yu
2017-01-09 22:03   ` Thomas Gleixner
2017-01-09 22:17     ` Fenghua Yu
2017-01-09 22:24     ` Shaohua Li
2017-01-09 21:58 ` Thomas Gleixner

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).