Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1374603imm; Fri, 22 Jun 2018 15:46:43 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLbhg863/uZ9ecAddpZQVtzAOMr+I04vpAp9683+H5q+IDV1zk1HkGXxd8OqA3kub2eCPkC X-Received: by 2002:a63:3584:: with SMTP id c126-v6mr2922580pga.217.1529707603336; Fri, 22 Jun 2018 15:46:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529707603; cv=none; d=google.com; s=arc-20160816; b=e3XGXvU+QwN+Jl41+O5Sj+XdiIRCbxP2j9IU9B5isy6i0tgJ8PZWfUpvxUEv1bJzcj dl/4gE9+hxXtPg7rX+jpiwlf4rGnMuHesMyqpFl9G5OCZMKM1TVLCukcU709Mb13+bja 0wGzaQzt8my8hSPM5teSj5r7+KYbOumIF9WJOQvbNfS2D6i939a4TzQw/HiFcjiXBcgS 0E11TWmevYVH/4/L4zGYHQTsA/ZeNl28JD3OLTa8dSWJyxOxskAYxjGzGd4FdCGDDge+ J4rE/Hur2gU7Xps+cUotXgouIgATHuYBdbc5gA23kfOLq0/4gV//I1VCPVzInDZgKyxK L66A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=tcJGuqEfUQhaOzJ5bdUj2GK2n+Vk3UhvkS59xOACkIk=; b=GxBGcvueoZxJTa0CiX67Y/GxYv19zHn0OeLK6pDSc4DBeGKCd6OsMkhVO7ENWlyuRX MRcIfWUrPBqfuP3kCOjxz9SCZq+rm8u+oXC8w045N4H3zXcFDhV+Yu2SKPIlwuCnib3x 5nLKHQJHb4rSBvhjvGqu/3vktOZIZStRDCSS1GukDfeETUjnSoygkkbmSaGNbXdMKYX0 v3RUWDUKL5Qh+nEsGpgemzozDJh6M2Gnoqm+m+tAOY9RAd6TffFEPQN94zrUsC7WrB1X bupcNyD/gbFK3V5sxI9I0TzI1hV9IVOCH0Q8qlUsVf2SBjW3lkfXlZ1RAujwl+dPWvIQ Tn5w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s4-v6si8357843pfs.157.2018.06.22.15.46.28; Fri, 22 Jun 2018 15:46:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754822AbeFVWpG (ORCPT + 99 others); Fri, 22 Jun 2018 18:45:06 -0400 Received: from mga02.intel.com ([134.134.136.20]:22312 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933957AbeFVWmz (ORCPT ); Fri, 22 Jun 2018 18:42:55 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jun 2018 15:42:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,259,1526367600"; d="scan'208";a="234843445" Received: from rchatre-s.jf.intel.com ([10.54.70.76]) by orsmga005.jf.intel.com with ESMTP; 22 Jun 2018 15:42:48 -0700 From: Reinette Chatre To: tglx@linutronix.de, fenghua.yu@intel.com, tony.luck@intel.com, vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com, jithu.joseph@intel.com, dave.hansen@intel.com, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org, Reinette Chatre Subject: [PATCH V7 32/41] x86/intel_rdt: Resctrl files reflect pseudo-locked information Date: Fri, 22 Jun 2018 15:42:23 -0700 Message-Id: <5ece82869b651c2178b278e00bca959f7626b6e9.1529706536.git.reinette.chatre@intel.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Information about resources as well as resource groups are contained in a variety of resctrl files. Now that pseudo-locked regions can be created the files can be updated to present appropriate information to the user. Update the resource group's schemata file to show only the information of the pseudo-locked region. Update the resource group's size file to show the size in bytes of only the pseudo-locked region. Update the bit_usage file to use the letter 'P' for all pseudo-locked regions. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/5ae3b3fea500e814f72047572f0cf94c353e9081.1527593971.git.reinette.chatre@intel.com --- arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c | 3 ++ arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 31 +++++++++++++++++---- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c b/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c index 6f4c0002b2c1..af358ca05160 100644 --- a/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c +++ b/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c @@ -402,6 +402,9 @@ int rdtgroup_schemata_show(struct kernfs_open_file *of, if (rdtgrp->mode == RDT_MODE_PSEUDO_LOCKSETUP) { for_each_alloc_enabled_rdt_resource(r) seq_printf(s, "%s:uninitialized\n", r->name); + } else if (rdtgrp->mode == RDT_MODE_PSEUDO_LOCKED) { + seq_printf(s, "%s:%d=%x\n", rdtgrp->plr->r->name, + rdtgrp->plr->d->id, rdtgrp->plr->cbm); } else { closid = rdtgrp->closid; for_each_alloc_enabled_rdt_resource(r) { diff --git a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c index 1069d08a35cd..cecf26e63e2c 100644 --- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c +++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c @@ -771,14 +771,16 @@ static int rdt_shareable_bits_show(struct kernfs_open_file *of, * H - currently used by hardware only but available for software use * S - currently used and shareable by software only * E - currently used exclusively by one resource group + * P - currently pseudo-locked by one resource group */ static int rdt_bit_usage_show(struct kernfs_open_file *of, struct seq_file *seq, void *v) { struct rdt_resource *r = of->kn->parent->priv; - u32 sw_shareable, hw_shareable, exclusive; + u32 sw_shareable = 0, hw_shareable = 0; + u32 exclusive = 0, pseudo_locked = 0; struct rdt_domain *dom; - int i, hwb, swb, excl; + int i, hwb, swb, excl, psl; enum rdtgrp_mode mode; bool sep = false; u32 *ctrl; @@ -803,12 +805,15 @@ static int rdt_bit_usage_show(struct kernfs_open_file *of, case RDT_MODE_EXCLUSIVE: exclusive |= *ctrl; break; + case RDT_MODE_PSEUDO_LOCKSETUP: /* - * Temporarily handle pseudo-locking enums - * to silence compile warnings until handling - * added in later patches. + * RDT_MODE_PSEUDO_LOCKSETUP is possible + * here but not included since the CBM + * associated with this CLOSID in this mode + * is not initialized and no task or cpu can be + * assigned this CLOSID. */ - case RDT_MODE_PSEUDO_LOCKSETUP: + break; case RDT_MODE_PSEUDO_LOCKED: case RDT_NUM_MODES: WARN(1, @@ -817,9 +822,11 @@ static int rdt_bit_usage_show(struct kernfs_open_file *of, } } for (i = r->cache.cbm_len - 1; i >= 0; i--) { + pseudo_locked = dom->plr ? dom->plr->cbm : 0; hwb = test_bit(i, (unsigned long *)&hw_shareable); swb = test_bit(i, (unsigned long *)&sw_shareable); excl = test_bit(i, (unsigned long *)&exclusive); + psl = test_bit(i, (unsigned long *)&pseudo_locked); if (hwb && swb) seq_putc(seq, 'X'); else if (hwb && !swb) @@ -828,6 +835,8 @@ static int rdt_bit_usage_show(struct kernfs_open_file *of, seq_putc(seq, 'S'); else if (excl) seq_putc(seq, 'E'); + else if (psl) + seq_putc(seq, 'P'); else /* Unused bits remain */ seq_putc(seq, '0'); } @@ -1147,6 +1156,15 @@ static int rdtgroup_size_show(struct kernfs_open_file *of, return -ENOENT; } + if (rdtgrp->mode == RDT_MODE_PSEUDO_LOCKED) { + seq_printf(s, "%*s:", max_name_width, rdtgrp->plr->r->name); + size = rdtgroup_cbm_to_size(rdtgrp->plr->r, + rdtgrp->plr->d, + rdtgrp->plr->cbm); + seq_printf(s, "%d=%u\n", rdtgrp->plr->d->id, size); + goto out; + } + for_each_alloc_enabled_rdt_resource(r) { seq_printf(s, "%*s:", max_name_width, r->name); list_for_each_entry(d, &r->domains, list) { @@ -1164,6 +1182,7 @@ static int rdtgroup_size_show(struct kernfs_open_file *of, seq_putc(s, '\n'); } +out: rdtgroup_kn_unlock(of->kn); return 0; -- 2.17.0