Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4962378ybi; Tue, 30 Jul 2019 11:13:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJ3oCFfkMTwb1T2f7PFtO9zk5ecn7YXe7/VCnlj3Ry7WzZSC+wt7h50zuoBe+UQGTg+bI7 X-Received: by 2002:a62:2f06:: with SMTP id v6mr43417507pfv.195.1564510383034; Tue, 30 Jul 2019 11:13:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564510383; cv=none; d=google.com; s=arc-20160816; b=hwnkLCt1j6MAVcxTev8Qz24QSR9lwTJjoCeONo25HRxeLJUUou1C20ZjAKEpGGXMPE 1CKhQAVvIUI4m5f5IiqxWfYMEgdIKWEesqvFVvei6k72fzVp0LuACX/5/8xICCBGoo+q mDAwnQh3Yu8WsyEuTb+gVIjJhM4Nd9zb/jfPd/rRi3N74UuGckLFtS8yvEDx+hNn/nbS VHJfR6ZadnbU2Hx/gxNYQUx8CN/w6AE0I/ScmZFaf/act+OWETuglZOrnogZWAwV/X6A 7660ELQiT138lmjmoHMZo3e0k/L17rGeRoSSIHcig4tZ0Ulhbakynb2FKRWq0/98nfwM ublg== 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; bh=gabJbHkqthVJZIuhe1qzPA41IP4pyZgzTJ26BzCD//o=; b=0DT1vywkuPmHEgWtxV3TJorXDdsXs7Fq0A54lyP8V2ZMRahQtT99nYTqHECVPHkbVo uHwZt4EK7pTT4DPC26QWuS7zBgX+UGZ6kexp+4F68CcTpbkM5Vk1TNABC1ItWe4W4LwU ZNEKZIuZucOV1K1HV8W8FgKyIHLuZTCyIdJI9QX+AMMa0Mv59OyG3fqA8P/G+chBP32A JGMWNELMwiPVy4mXraUEMcVD/xvDG+xuoC9B4P/bwOze0l0mlwZTb4BtSTdU2O4ebr7r W6ELI9MfNofvLfeE02F2VjSlJIbmbIsbmM3eRCBvekcA8TCyRkpMpY3k0ta7ZQIXATRL /9iw== 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 v19si27966563pff.229.2019.07.30.11.12.46; Tue, 30 Jul 2019 11:13:03 -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 S1731035AbfG3RcO (ORCPT + 99 others); Tue, 30 Jul 2019 13:32:14 -0400 Received: from mga01.intel.com ([192.55.52.88]:35736 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731015AbfG3RcL (ORCPT ); Tue, 30 Jul 2019 13:32:11 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jul 2019 10:32:09 -0700 X-IronPort-AV: E=Sophos;i="5.64,327,1559545200"; d="scan'208";a="162655272" Received: from rchatre-s.jf.intel.com ([10.54.70.76]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jul 2019 10:32:09 -0700 From: Reinette Chatre To: tglx@linutronix.de, fenghua.yu@intel.com, bp@alien8.de, tony.luck@intel.com Cc: kuo-lang.tseng@intel.com, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org, Reinette Chatre Subject: [PATCH V2 02/10] x86/resctrl: Remove unnecessary size compute Date: Tue, 30 Jul 2019 10:29:36 -0700 Message-Id: <38ea88f7e404169f74f87e1b1b7737d204dbee2a.1564504901.git.reinette.chatre@intel.com> X-Mailer: git-send-email 2.17.2 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 a cache pseudo-locked region is maintained in its struct pseudo_lock_region. One of these properties is the size of the region that is computed before it is created and does not change over the pseudo-locked region's lifetime. When displaying the size of the pseudo-locked region to the user it is thus not necessary to compute the size again from other properties, it could just be printed directly from its struct. The code being changed is entered only when the resource group is pseudo-locked. At this time the pseudo-locked region has already been created and the size property would thus be valid. Signed-off-by: Reinette Chatre --- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index a46dee8e78db..3985097ce728 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -1308,10 +1308,8 @@ static int rdtgroup_size_show(struct kernfs_open_file *of, } else { 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); + seq_printf(s, "%d=%u\n", rdtgrp->plr->d->id, + rdtgrp->plr->size); } goto out; } -- 2.17.2