Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3801852imm; Tue, 29 May 2018 14:04:00 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKWX3IThkr5cQEIELS6xaHeor/LNbVf0Jptu9/yFIn7y8EJvdtOxfsGfWG+Tqixr7TMCikS X-Received: by 2002:a17:902:d90f:: with SMTP id c15-v6mr23889plz.65.1527627840766; Tue, 29 May 2018 14:04:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527627840; cv=none; d=google.com; s=arc-20160816; b=FOz2gX7ctcH8OTDaXSQTCUDJoGaE3eXBHKrd8h5adCJlEA0w/LCCYPSWi3KO14edJx SljX0rCjpXoR4M/kJw6r628YWXCPC80PB/7lB3lIfBLGXwh7Qr6mbxOGoKxf1QxzvPrD yROJOv4LKQAUKiJfwSg8YDBdtIB155bRwrLuC72Da6k8DT+pWvFU8f3DQe1wprcZQ8zW nIAjx7GDlATKrew/KP5UDIJC2j8EQSZFGBPWnE0P/KRXBX+9B2QddbyxcNrAiuPQbVDp T3j5H09EAtYBq+wSAjX738eAwwvr0gemx4v+1/fMPe44UocQBHg7/uqyeJ6l8TnulODj 748g== 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=Xb2yAtRYeBWPwj6ObkcZPOM5JrrAwD6mMQq7wMIr9jI=; b=lSj0Mj689A5n+Q9HSUq8Lg8CqjTUtV1+4QtYYGy8w9n4yNCk7RsRyEJKxCCM2qEPMK sq+Ad1xpuEy+y6zG+2r+FTK9J9fV7PPP12OxEWr+I8RjiGmre6nbJe6CfFB3IgfYUQEC VIJvvBksB0cjit90aNahUUOTbtfWWimq0D3thdmN0a1J9K1hZWOynX8qV21jnbho2lJG wZV6CO8x1Lh0iDbrNLk3qrZyUMViUPzaq24xpiTGCsUyRPuEbUWgyPPGuT/cCEz086/C S5DrABs/KfyT+gA9UA3IpursB4n8drsQs/91kjFlpkEeW0lYQKbf0i7TsHD/n11+l6jy 5kZA== 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 o1-v6si21731436pga.261.2018.05.29.14.03.46; Tue, 29 May 2018 14:04:00 -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 S967084AbeE2VB4 (ORCPT + 99 others); Tue, 29 May 2018 17:01:56 -0400 Received: from mga01.intel.com ([192.55.52.88]:53965 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966917AbeE2VBR (ORCPT ); Tue, 29 May 2018 17:01:17 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 May 2018 14:00:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,457,1520924400"; d="scan'208";a="60127763" Received: from rchatre-s.jf.intel.com ([10.54.70.76]) by orsmga001.jf.intel.com with ESMTP; 29 May 2018 14:00:55 -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 V5 31/38] x86/intel_rdt: resctrl files reflect pseudo-locked information Date: Tue, 29 May 2018 05:57:56 -0700 Message-Id: <5ae3b3fea500e814f72047572f0cf94c353e9081.1527593971.git.reinette.chatre@intel.com> X-Mailer: git-send-email 2.13.6 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 --- 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 bc5180aa3c9a..0f8fb894db15 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'); } @@ -1146,6 +1155,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) { @@ -1163,6 +1181,7 @@ static int rdtgroup_size_show(struct kernfs_open_file *of, seq_putc(s, '\n'); } +out: rdtgroup_kn_unlock(of->kn); return 0; -- 2.13.6