Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp625634pxj; Thu, 17 Jun 2021 10:04:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhS/CJUq+iC4yzQDSvYgSuiWhjZ5uD6FC2D2caFpirilIYhs5rVg70YcSLg87cLlyZ8UVB X-Received: by 2002:a5e:d616:: with SMTP id w22mr4771249iom.75.1623949441015; Thu, 17 Jun 2021 10:04:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623949441; cv=none; d=google.com; s=arc-20160816; b=EKjiZ4wrwygQXR8woQkTk7YnRF7HtO4ly1Mwbzo46R84NlhBU0SQJtNVOIss3eQvDs T7lnMpMTQQR1kOEjc75dkXOEWtr1MtQKhGl3pfuv7Qd/yYIC16epeinPVWVD6hLg6Llm fj4gF9sO6sGRoVQ8Juhfh5Ls/7kVVOO770BlgKfm7gtVgcvyAKT95nWUeAkYbZIiqvWN 3l6KuGpsLzw4qMYk+kKciL280vt5ZMhJagF8LKtV4V2tFCiEKhsaEfjn4PJMPsmH4fyb C8Qr0Ml83qh21rckbyInMTi1LntZNI4uNTtaJvbZHD0HL2J98aeqcPN56c/VszkzXhUn d/lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=6csSjuu4Z/M1OQMHD5+SY/xWPue6eyo0k+N6/WFV+Eo=; b=0PVRHrAACwuwbEoNRKODSTAzNbT8NiLYKO/CwZ3vrEunxBRI2iaH242Myq4alBqhR6 Vj2WvvBvadov0iqoHZaUPOhn/6iuAnQAPty40UXG6/aLRSYVmP+tsZKHLby1gLKZezur vYbroGcTMMUwNWR+H5L1W5AB++3K+KEREPdckMvXqeUQxe7OKNrIvaeTxjXNqVktZ1k2 dBszs/rELnG5eC4J7GQnknDl1Tks15pDVi6qTJBNCnGUvq4zaMWIfpAXYH5EvX48ig8M dANVwSlZDox0KJWSqjLaMFKUjbKUzp7pXQ823xfKvZhu1z5HWcc8w9maxhSenbNDHO9x Px/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 q49si6414971jav.91.2021.06.17.10.03.45; Thu, 17 Jun 2021 10:04:01 -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 S230217AbhFQRFM (ORCPT + 99 others); Thu, 17 Jun 2021 13:05:12 -0400 Received: from foss.arm.com ([217.140.110.172]:56726 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229683AbhFQRFL (ORCPT ); Thu, 17 Jun 2021 13:05:11 -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 2736D13D5; Thu, 17 Jun 2021 10:03:03 -0700 (PDT) Received: from [192.168.0.14] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2B91D3F694; Thu, 17 Jun 2021 10:03:01 -0700 (PDT) Subject: Re: [PATCH v4 03/24] x86/resctrl: Add a separate schema list for resctrl To: Babu Moger , x86@kernel.org, linux-kernel@vger.kernel.org Cc: Fenghua Yu , Reinette Chatre , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , shameerali.kolothum.thodi@huawei.com, Jamie Iles , D Scott Phillips OS , lcherian@marvell.com References: <20210614200941.12383-1-james.morse@arm.com> <20210614200941.12383-4-james.morse@arm.com> <8626fde4-ed22-be80-e36f-45a16e5eceaa@amd.com> From: James Morse Message-ID: <1de354b1-63f7-5098-6468-96509eddf956@arm.com> Date: Thu, 17 Jun 2021 18:02:59 +0100 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <8626fde4-ed22-be80-e36f-45a16e5eceaa@amd.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Babu, On 15/06/2021 18:51, Babu Moger wrote: > On 6/14/21 3:09 PM, James Morse wrote: >> Resctrl exposes schemata to user-space, which allow the control values >> to be specified for a group of tasks. >> >> User-visible properties of the interface, (such as the schemata names >> and how the values are parsed) are rooted in a struct provided by the >> architecture code. (struct rdt_hw_resource). Once a second architecture >> uses resctrl, this would allow user-visible properties to diverge >> between architectures. >> >> These properties should come from the resctrl code that will be common >> to all architectures. Resctrl has no per-schema structure, only struct >> rdt_{hw_,}resource. Create a struct resctrl_schema to hold the >> rdt_resource. Before a second architecture can be supported, this >> structure will also need to hold the schema name visible to user-space >> and the type of configuration values for resctrl. >> diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h >> index be6f5df78e31..425e7913dc8d 100644 >> --- a/include/linux/resctrl.h >> +++ b/include/linux/resctrl.h >> @@ -154,4 +154,15 @@ struct rdt_resource { >> >> }; >> >> +/** >> + * struct resctrl_schema - configuration abilities of a resource presented to >> + * user-space >> + * @list: Member of resctrl_schema_all. >> + * @res: The resource structure exported by the architecture to describe >> + * the hardware that is configured by this schema. >> + */ >> +struct resctrl_schema { >> + struct list_head list; >> + struct rdt_resource *res; > It will be better to be consistent with the naming. > struct rdt_resource *resctrl; Consistent with what? The rest of the code base conventionally calls a resource 'r'. The structures with '_hw_' are private to the architecture, the 'resctrl' structure there is the part of the struct that the architecture makes visible to the filesystem of that name. That pattern doesn't apply here, 'struct resctrl_schema' is an invention of the filesystem, the architecture code doesn't need to know anything about it. (this is why it goes in include/linux from the beginning). I think the choices are 'r', (too terse), 'resource' (too much typing, obvious from the type), or 'res'... Thanks! James