linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shaohua Li <shli@fb.com>
To: <linux-kernel@vger.kernel.org>
Cc: Fenghua Yu <fenghua.yu@intel.com>, Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH] x86/intel_rdt: reinitialize cbm for new group allocation
Date: Fri, 6 Jan 2017 16:05:19 -0800	[thread overview]
Message-ID: <91a513378542f2d81e39baf954d8f8c447fd1943.1483747472.git.shli@fb.com> (raw)

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

             reply	other threads:[~2017-01-07  0:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-07  0:05 Shaohua Li [this message]
2017-01-09 21:56 ` [PATCH] x86/intel_rdt: reinitialize cbm for new group allocation 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

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=91a513378542f2d81e39baf954d8f8c447fd1943.1483747472.git.shli@fb.com \
    --to=shli@fb.com \
    --cc=fenghua.yu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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).