From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034751AbdAGAGp (ORCPT ); Fri, 6 Jan 2017 19:06:45 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:38097 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752028AbdAGAFX (ORCPT ); Fri, 6 Jan 2017 19:05:23 -0500 Smtp-Origin-Hostprefix: devbig From: Shaohua Li Smtp-Origin-Hostname: devbig638.prn2.facebook.com To: CC: Fenghua Yu , Thomas Gleixner Smtp-Origin-Cluster: prn2c22 Subject: [PATCH] x86/intel_rdt: reinitialize cbm for new group allocation Date: Fri, 6 Jan 2017 16:05:19 -0800 Message-ID: <91a513378542f2d81e39baf954d8f8c447fd1943.1483747472.git.shli@fb.com> X-Mailer: git-send-email 2.9.3 X-FB-Internal: Safe MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-01-06_18:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Thomas Gleixner Signed-off-by: Shaohua Li --- 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