public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Amit Singh Tomar <amitsinght@marvell.com>
Cc: <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <fenghua.yu@intel.com>,
	<reinette.chatre@intel.com>, <james.morse@arm.com>,
	<gcherian@marvell.com>, <robh@kernel.org>,
	<peternewman@google.com>
Subject: Re: [RFC 02/12] arm_mpam: resctrl: Detect priority partitioning capability
Date: Fri, 1 Sep 2023 13:30:19 +0100	[thread overview]
Message-ID: <20230901133019.000033b2@Huawei.com> (raw)
In-Reply-To: <20230815152712.1760046-3-amitsinght@marvell.com>

On Tue, 15 Aug 2023 20:57:02 +0530
Amit Singh Tomar <amitsinght@marvell.com> wrote:

> ARM MPAM supports different control that can be applied to different
> resources in the system, for instance priority partitioning control
> where priority value is generated from one MSC, propagates over
> interconnect to other MSC (known as downstream priority), or can be
> applied within an MSC for internal operations.

Hi Amit,

This talks about INTPRI as well as DSPRI, but only checks for DSPRI.
I couldn't work out why my INTPRI test wasn't resulting in anything
new turning up in schemata.

Should make that clear  However even better would be to enable both
and we definitely want an interface that allows for either or both.

Jonathan

> 
> This change lets the resctrl know the about MSC's priority partitioning
> capability.
> 
> Signed-off-by: Amit Singh Tomar <amitsinght@marvell.com>
> ---
>  drivers/platform/mpam/mpam_resctrl.c | 14 ++++++++++++++
>  include/linux/resctrl.h              |  4 ++++
>  2 files changed, 18 insertions(+)
> 
> diff --git a/drivers/platform/mpam/mpam_resctrl.c b/drivers/platform/mpam/mpam_resctrl.c
> index 1dbfb6f6dd34..09618d9ceb1d 100644
> --- a/drivers/platform/mpam/mpam_resctrl.c
> +++ b/drivers/platform/mpam/mpam_resctrl.c
> @@ -435,6 +435,16 @@ static bool cache_has_usable_cpor(struct mpam_class *class)
>  	return (class->props.cpbm_wd <= RESCTRL_MAX_CBM);
>  }
>  
> +static bool cache_has_usable_priority_part(struct mpam_class *class)
> +{
> +	struct mpam_props *cprops = &class->props;
> +
> +	if (!mpam_has_feature(mpam_feat_dspri_part, cprops))
> +		return false;
> +
> +	return (class->props.dspri_wd <= RESCTRL_MAX_DSPRI);
> +}
> +
>  static bool cache_has_usable_csu(struct mpam_class *class)
>  {
>  	struct mpam_props *cprops;
> @@ -691,6 +701,7 @@ static int mpam_resctrl_resource_init(struct mpam_resctrl_res *res)
>  	    res->resctrl_res.rid == RDT_RESOURCE_L3) {
>  		bool has_csu = cache_has_usable_csu(class);
>  		bool has_mbwu = class_has_usable_mbwu(class);
> +		bool has_ppart = cache_has_usable_priority_part(class);
>  
>  		/* TODO: Scaling is not yet supported */
>  		r->cache.cbm_len = class->props.cpbm_wd;
> @@ -718,6 +729,9 @@ static int mpam_resctrl_resource_init(struct mpam_resctrl_res *res)
>  			exposed_alloc_capable = true;
>  		}
>  
> +		if (has_ppart)
> +			r->priority_cap = true;
> +
>  		/*
>  		 * MBWU counters may be 'local' or 'total' depending on where
>  		 * they are in the topology. If The counter is on the L3, its
> diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h
> index 3ad308e9e226..a98ba5828211 100644
> --- a/include/linux/resctrl.h
> +++ b/include/linux/resctrl.h
> @@ -38,6 +38,8 @@ int proc_resctrl_show(struct seq_file *m,
>   */
>  #define RESCTRL_MAX_CBM			32
>  
> +#define RESCTRL_MAX_DSPRI               63
> +
>  /* The format for packing fields into the u64 'id' exposed to user-space */
>  #define RESCTRL_ID_CLOSID	GENMASK_ULL(31, 0)
>  #define RESCTRL_ID_RMID		GENMASK_ULL(63, 32)
> @@ -195,6 +197,7 @@ struct resctrl_membw {
>   * @rid:		The index of the resource
>   * @alloc_capable:	Is allocation available on this machine
>   * @mon_capable:	Is monitor feature available on this machine
> + * @priority_capable:   Is priority partitioning feature available on this machine
>   * @num_rmid:		Number of RMIDs available
>   * @cache_level:	Which cache level defines scope of this resource
>   * @cache:		Cache allocation related data
> @@ -212,6 +215,7 @@ struct rdt_resource {
>  	int			rid;
>  	bool			alloc_capable;
>  	bool			mon_capable;
> +	bool                    priority_cap;
>  	int			num_rmid;
>  	int			cache_level;
>  	struct resctrl_cache	cache;


  reply	other threads:[~2023-09-01 12:30 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-15 15:27 [RFC 00/12] ARM: MPAM: add support for priority partitioning control Amit Singh Tomar
2023-08-15 15:27 ` [RFC 01/12] arm_mpam: Handle resource instances mapped to different controls Amit Singh Tomar
2023-09-01 12:39   ` Jonathan Cameron
2023-08-15 15:27 ` [RFC 02/12] arm_mpam: resctrl: Detect priority partitioning capability Amit Singh Tomar
2023-09-01 12:30   ` Jonathan Cameron [this message]
2023-08-15 15:27 ` [RFC 03/12] arm_mpam: resctrl: Define new schemata format for priority partition Amit Singh Tomar
2023-08-15 15:27 ` [RFC 04/12] fs/resctrl: Obtain CPBM upon priority partition presence Amit Singh Tomar
2023-08-15 15:27 ` [RFC 05/12] fs/resctrl: Set-up downstream priority partition resources Amit Singh Tomar
2023-08-17 17:39   ` Fenghua Yu
2023-08-15 15:27 ` [RFC 06/12] fs/resctrl: Extend schemata read for priority partition control Amit Singh Tomar
2023-08-17 17:42   ` Fenghua Yu
2023-08-15 15:27 ` [RFC 07/12] arm_mpam: resctrl: Retrieve priority values from arch code Amit Singh Tomar
2023-08-15 15:27 ` [RFC 08/12] fs/resctrl: Schemata write only for intended resource Amit Singh Tomar
2023-08-15 15:27 ` [RFC 09/12] fs/resctrl: Extend schemata write for priority partition control Amit Singh Tomar
2023-08-17 17:27   ` Fenghua Yu
2023-08-17 17:53   ` Fenghua Yu
2023-08-15 15:27 ` [RFC 10/12] arm_mpam: resctrl: Facilitate writing downstream priority value Amit Singh Tomar
2023-08-15 15:27 ` [RFC 11/12] arm_mpam: Fix Downstream priority mask Amit Singh Tomar
2023-09-01 13:32   ` Jonathan Cameron
2023-08-15 15:27 ` [RFC 12/12] arm_mpam: Program Downstream priority value Amit Singh Tomar
2023-09-01 13:17   ` Jonathan Cameron
2023-08-17 19:11 ` [RFC 00/12] ARM: MPAM: add support for priority partitioning control Reinette Chatre
2023-08-17 20:29   ` Reinette Chatre
2023-08-22 12:44   ` [EXT] " Amit Singh Tomar
2023-08-23 19:06     ` Reinette Chatre
2023-08-23 21:33       ` Amit Singh Tomar
2023-08-23 22:20         ` Reinette Chatre
2023-08-23 22:36           ` Luck, Tony
2023-08-24  8:52           ` Amit Singh Tomar
2023-08-24 15:30             ` Luck, Tony
2023-08-24 18:00             ` Reinette Chatre
2024-01-11 20:56             ` Peter Newman
2024-01-11 21:40               ` Tony Luck
2024-01-11 22:01                 ` Reinette Chatre
2024-01-11 23:14                   ` Luck, Tony
2024-01-11 23:31                     ` Reinette Chatre
2023-08-22  9:01 ` Peter Newman
2023-09-01 14:42 ` Jonathan Cameron
2023-09-01 15:04 ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230901133019.000033b2@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=amitsinght@marvell.com \
    --cc=fenghua.yu@intel.com \
    --cc=gcherian@marvell.com \
    --cc=james.morse@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peternewman@google.com \
    --cc=reinette.chatre@intel.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox