Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1759955pxj; Wed, 19 May 2021 13:16:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCsT6pJNc5aVFnAN/3XwosLgHDVxHmwypqAd14n11zZRSBiy3MYVVgffCSPKLXV3b6T35q X-Received: by 2002:a6b:5c04:: with SMTP id z4mr1477739ioh.51.1621455376239; Wed, 19 May 2021 13:16:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621455376; cv=none; d=google.com; s=arc-20160816; b=PaXO2r849cRfS45g/CiZHb2fAI3zXhVLgPbPrALoCoBznyy75n0O+HXX0e2ziROwVH 48HWYFDrlU3S/oXmiBkl7MS+u3qNSEUuEWRhTAkOV9+ceflQGeiE+hCAi7ZGsWCzvBk2 ETKPu91Uy4dbGH0yQtDnOVwU57tsekL0y1laQMt3GB09p9UIPcg366XM7AcyJq+GuEus geWWvolu1Oa+m7PVoHX+4VzuCOtdVSjBEadBzqgh9BqNJSeZxc8XO+TG58ws0DzHTVSL 4VdGOQUK5hqnbAiGLt7pjYQ/gTR2V0ylgk5YaZ9FvoCzNpgOladaIckGBgo78raDykkS LEEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=I5v5LkhlDmNvqFc7hNRYJvZMI5I5G2dSM5shtf76pWA=; b=Nv2J2wPKRuwDEz3KLp1dDyrkFvnpZ+KfiJexvhJ0g+Pj3xIVKXtlypCatpGC7jwfjO ZENBt9jeyUgec386mv6rP4D/dA5CzHEtggNvtBYlETBlLGw2h6zD78PmQH16C+KDTbIC mOMMBSmStLGbRl8sMg2FBh4ADLuji/UG79+iH4J7It9OfnFJHO1rhzE3PivQ4onz31tP CqsruYeYZatoTN3eB7aOHlpdfqLxBIGzOvpIaTjs7GYi7w/xhbhTisjj7IisX6ApYmc9 oRSIz1ciHasa8FDVd03/5JuTK+/80RhxhlDGk47pJPfsTZd7kR+C+5+Hy8mh3wqOIbel o+/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w8si271821iou.72.2021.05.19.13.16.03; Wed, 19 May 2021 13:16:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355342AbhESQ1T (ORCPT + 99 others); Wed, 19 May 2021 12:27:19 -0400 Received: from foss.arm.com ([217.140.110.172]:48242 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355253AbhESQ0u (ORCPT ); Wed, 19 May 2021 12:26:50 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C68671682; Wed, 19 May 2021 09:25:27 -0700 (PDT) Received: from merodach.members.linode.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 14DAE3F73D; Wed, 19 May 2021 09:25:25 -0700 (PDT) From: James Morse To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: Fenghua Yu , Reinette Chatre , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Babu Moger , James Morse , shameerali.kolothum.thodi@huawei.com, Jamie Iles , D Scott Phillips OS Subject: [PATCH v3 10/24] x86/resctrl: Swizzle rdt_resource and resctrl_schema in pseudo_lock_region Date: Wed, 19 May 2021 16:24:10 +0000 Message-Id: <20210519162424.27654-11-james.morse@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210519162424.27654-1-james.morse@arm.com> References: <20210519162424.27654-1-james.morse@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org struct pseudo_lock_region points to the rdt_resource. Once the resources are merged, this won't be unique. The resource name is moving into the schema, so that the filesystem portions of resctrl can generate it. Swap pseudo_lock_region's rdt_resource pointer for a schema pointer. Reviewed-by: Jamie Iles Signed-off-by: James Morse --- Changes since v2: * Shuffled commit message, --- arch/x86/kernel/cpu/resctrl/ctrlmondata.c | 4 ++-- arch/x86/kernel/cpu/resctrl/internal.h | 6 +++--- arch/x86/kernel/cpu/resctrl/pseudo_lock.c | 8 ++++---- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c index dbbdd9f275e9..4428ec499037 100644 --- a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c +++ b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c @@ -227,7 +227,7 @@ static int parse_line(char *line, struct resctrl_schema *s, * the required initialization for single * region and return. */ - rdtgrp->plr->r = r; + rdtgrp->plr->s = s; rdtgrp->plr->d = d; rdtgrp->plr->cbm = d->new_ctrl; d->plr = rdtgrp->plr; @@ -426,7 +426,7 @@ int rdtgroup_schemata_show(struct kernfs_open_file *of, ret = -ENODEV; } else { seq_printf(s, "%s:%d=%x\n", - rdtgrp->plr->r->name, + rdtgrp->plr->s->res->name, rdtgrp->plr->d->id, rdtgrp->plr->cbm); } diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h index 34e90bfca2d9..a733d1d02f3f 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -158,8 +158,8 @@ struct mongroup { /** * struct pseudo_lock_region - pseudo-lock region information - * @r: RDT resource to which this pseudo-locked region - * belongs + * @s: Resctrl schema for the resource to which this + * pseudo-locked region belongs * @d: RDT domain to which this pseudo-locked region * belongs * @cbm: bitmask of the pseudo-locked region @@ -179,7 +179,7 @@ struct mongroup { * @pm_reqs: Power management QoS requests related to this region */ struct pseudo_lock_region { - struct rdt_resource *r; + struct resctrl_schema *s; struct rdt_domain *d; u32 cbm; wait_queue_head_t lock_thread_wq; diff --git a/arch/x86/kernel/cpu/resctrl/pseudo_lock.c b/arch/x86/kernel/cpu/resctrl/pseudo_lock.c index f079561409ab..2f99210a9d69 100644 --- a/arch/x86/kernel/cpu/resctrl/pseudo_lock.c +++ b/arch/x86/kernel/cpu/resctrl/pseudo_lock.c @@ -246,7 +246,7 @@ static void pseudo_lock_region_clear(struct pseudo_lock_region *plr) plr->line_size = 0; kfree(plr->kmem); plr->kmem = NULL; - plr->r = NULL; + plr->s = NULL; if (plr->d) plr->d->plr = NULL; plr->d = NULL; @@ -290,10 +290,10 @@ static int pseudo_lock_region_init(struct pseudo_lock_region *plr) ci = get_cpu_cacheinfo(plr->cpu); - plr->size = rdtgroup_cbm_to_size(plr->r, plr->d, plr->cbm); + plr->size = rdtgroup_cbm_to_size(plr->s->res, plr->d, plr->cbm); for (i = 0; i < ci->num_leaves; i++) { - if (ci->info_list[i].level == plr->r->cache_level) { + if (ci->info_list[i].level == plr->s->res->cache_level) { plr->line_size = ci->info_list[i].coherency_line_size; return 0; } @@ -796,7 +796,7 @@ bool rdtgroup_cbm_overlaps_pseudo_locked(struct rdt_domain *d, unsigned long cbm unsigned long cbm_b; if (d->plr) { - cbm_len = d->plr->r->cache.cbm_len; + cbm_len = d->plr->s->res->cache.cbm_len; cbm_b = d->plr->cbm; if (bitmap_intersects(&cbm, &cbm_b, cbm_len)) return true; diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 301a8acfaaf3..eaad9c8e6c04 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -1439,8 +1439,8 @@ static int rdtgroup_size_show(struct kernfs_open_file *of, ret = -ENODEV; } else { seq_printf(s, "%*s:", max_name_width, - rdtgrp->plr->r->name); - size = rdtgroup_cbm_to_size(rdtgrp->plr->r, + rdtgrp->plr->s->res->name); + size = rdtgroup_cbm_to_size(rdtgrp->plr->s->res, rdtgrp->plr->d, rdtgrp->plr->cbm); seq_printf(s, "%d=%u\n", rdtgrp->plr->d->id, size); -- 2.30.2