Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1080987ybd; Wed, 26 Jun 2019 10:51:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqzsH70bcbV6pyu+cKLCJO01hDSo5snYcxtKz2UmbmZxwmTk2Oc95I8pg+YcT1gmE1gi4RgX X-Received: by 2002:a63:205b:: with SMTP id r27mr4203372pgm.330.1561571497759; Wed, 26 Jun 2019 10:51:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561571497; cv=none; d=google.com; s=arc-20160816; b=qTfxihDoyDcOjGPo0BLptL7w2Zpazzk9QpHVAtIJGrUSboEsef7Q8b019FZ0ZaP0GC B1RHEpeqzqQrx3WsnOJ1RS5Y5k50PPAWB/x0P6WL8Y+lsGmvgxA/omNi5uhZEY/D+oLG jZ6aAszh+tHXXd3RyVO7x3xoxWvB+D1qYHrgqGZs0iioeIRFuHHlgB8F3Epbe8kDkgKx 7YdLWQpeo316Ww6GaRw++88YxgBkebh8oMcZv2mVIC3hOJT0VwrxZXPX4wnd3DDGH+WZ oclG1S1g3Rh82zZhI5n+y+nAYgCarZGmSXu6F5NHbeZzvy8r6ILHnajqGdhkxLOHC1+0 cz7Q== 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=HGCVyCwtGi0nhHbyMWG9tDRsoBRgJAMP6pibvF+HpvE=; b=R6SSQU9r9yFgJ7+8sIJ79DjjWVk08zwXXi47xquCYxMYFHwOnAsLWGcGuQ6u7bD9nT VPqltHW0se4T86iJf2Net93+7dzJjRggLem2+k0dXsw01DmNhNo+KW7swTtBa9etEsHy qqqtbvxYly7fwN38out3r9dHylFDyPJM64aVmcSSo1GK7g2GdQkk56j4a1aFI5rxzyrX 3XhOVXkT0QK49FlbihP82S2naXm5viKsOXAe7UN2p1BMKfW9res6PTV3Y+fvTmTN+4xH ytxhNmDcnrC1ui1VVTQenJ0RB3x1RVhtTg76i4XoZ3Ys3fMD+HSwoNEsATfUp8vUpnAE HnPg== 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 y12si16724164pgr.329.2019.06.26.10.51.21; Wed, 26 Jun 2019 10:51:37 -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 S1726591AbfFZRvM (ORCPT + 99 others); Wed, 26 Jun 2019 13:51:12 -0400 Received: from mga01.intel.com ([192.55.52.88]:49814 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726223AbfFZRvJ (ORCPT ); Wed, 26 Jun 2019 13:51:09 -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 fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jun 2019 10:51:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,420,1557212400"; d="scan'208";a="337288585" Received: from rchatre-s.jf.intel.com ([10.54.70.76]) by orsmga005.jf.intel.com with ESMTP; 26 Jun 2019 10:51:08 -0700 From: Reinette Chatre To: tglx@linutronix.de, fenghua.yu@intel.com, bp@alien8.de, tony.luck@intel.com Cc: mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org, Reinette Chatre Subject: [PATCH 02/10] x86/resctrl: Remove unnecessary size compute Date: Wed, 26 Jun 2019 10:48:41 -0700 Message-Id: <22c7b48603642b02bf1ff66692ae41eee9034dee.1561569068.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 bf3034994754..721fd7b0b0dc 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