linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@intel.com>
To: James Morse <james.morse@arm.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Cc: Fenghua Yu <fenghua.yu@intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	shameerali.kolothum.thodi@huawei.com,
	Jamie Iles <jamie@nuviainc.com>,
	D Scott Phillips OS <scott@os.amperecomputing.com>
Subject: Re: [PATCH 02/24] x86/resctrl: Split struct rdt_domain
Date: Tue, 17 Nov 2020 11:22:08 -0800	[thread overview]
Message-ID: <768d3fe3-336f-70d6-d406-1d3f25b7f3bf@intel.com> (raw)
In-Reply-To: <20201030161120.227225-3-james.morse@arm.com>

Hi James,

On 10/30/2020 9:10 AM, James Morse wrote:
> resctrl is the defacto Linux ABI for SoC resource partitioning features.
> To support it on another architecture, it needs to be abstracted from
> Intel RDT, and moved it to /fs/.

Same comments as previous patch regarding "Intel RDT" and "moved it to"

> 
> Split struct rdt_domain up too. Move everything that that is particular

s/that that/that/

> to resctrl into a new header file. resctrl code paths touching a 'hw'
> struct indicates where an abstraction is needed.
> 
> No change in behaviour, this patch just moves types around.

Please remove the "this patch" term.

> 
> Signed-off-by: James Morse <james.morse@arm.com>
> ---
>   arch/x86/kernel/cpu/resctrl/core.c        | 32 +++++++++++-------
>   arch/x86/kernel/cpu/resctrl/ctrlmondata.c | 10 ++++--
>   arch/x86/kernel/cpu/resctrl/internal.h    | 40 +++++------------------
>   arch/x86/kernel/cpu/resctrl/monitor.c     |  8 +++--
>   arch/x86/kernel/cpu/resctrl/rdtgroup.c    | 29 ++++++++++------
>   include/linux/resctrl.h                   | 35 +++++++++++++++++++-
>   6 files changed, 94 insertions(+), 60 deletions(-)
> 

...
> diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h
> index bcae86138cad..f7aab9245259 100644
> --- a/arch/x86/kernel/cpu/resctrl/internal.h
> +++ b/arch/x86/kernel/cpu/resctrl/internal.h
> @@ -299,44 +299,22 @@ struct mbm_state {
>   };
>   
>   /**
> - * struct rdt_domain - group of cpus sharing an RDT resource
> - * @list:	all instances of this resource
> - * @id:		unique id for this instance
> - * @cpu_mask:	which cpus share this resource
> - * @rmid_busy_llc:
> - *		bitmap of which limbo RMIDs are above threshold
> - * @mbm_total:	saved state for MBM total bandwidth
> - * @mbm_local:	saved state for MBM local bandwidth
> - * @mbm_over:	worker to periodically read MBM h/w counters
> - * @cqm_limbo:	worker to periodically read CQM h/w counters
> - * @mbm_work_cpu:
> - *		worker cpu for MBM h/w counters
> - * @cqm_work_cpu:
> - *		worker cpu for CQM h/w counters
> + * struct rdt_hw_domain - group of cpus sharing an RDT resource

s/RDT/resctrl/?

Even so, looking ahead, struct rdt_hw_domain and struct rdt_domain are 
receiving duplicate descriptions that needs to be adjusted.

Also, CPU is preferred instead of cpu. I understand that in some cases 
you copy existing usage and I am actually not sure if this would be 
insisted upon when going to the next level of review. Since these are 
comments changing it does seem like a good time to use preferred term.

> + * @resctrl:    Properties exposed to the resctrl file system

Please use tabs and spaces consistently.

>    * @ctrl_val:	array of cache or mem ctrl values (indexed by CLOSID)
>    * @mbps_val:	When mba_sc is enabled, this holds the bandwidth in MBps
> - * @new_ctrl:	new ctrl value to be loaded
> - * @have_new_ctrl: did user provide new_ctrl for this domain
> - * @plr:	pseudo-locked region (if any) associated with domain
>    */
> -struct rdt_domain {
> -	struct list_head		list;
> -	int				id;
> -	struct cpumask			cpu_mask;
> -	unsigned long			*rmid_busy_llc;
> -	struct mbm_state		*mbm_total;
> -	struct mbm_state		*mbm_local;
> -	struct delayed_work		mbm_over;
> -	struct delayed_work		cqm_limbo;
> -	int				mbm_work_cpu;
> -	int				cqm_work_cpu;
> +struct rdt_hw_domain {
> +	struct rdt_domain		resctrl;
>   	u32				*ctrl_val;
>   	u32				*mbps_val;
> -	u32				new_ctrl;
> -	bool				have_new_ctrl;
> -	struct pseudo_lock_region	*plr;
>   };
>   
> +static inline struct rdt_hw_domain *resctrl_to_arch_dom(struct rdt_domain *r)
> +{
> +	return container_of(r, struct rdt_hw_domain, resctrl);
> +}
> +
>   /**
>    * struct msr_param - set a range of MSRs from a domain
>    * @res:       The resource to use

...

> diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h
> index b2c2b7386d28..f5af59b8f2a9 100644
> --- a/include/linux/resctrl.h
> +++ b/include/linux/resctrl.h
> @@ -15,7 +15,40 @@ int proc_resctrl_show(struct seq_file *m,
>   
>   #endif
>   
> -struct rdt_domain;
> +/**
> + * struct rdt_domain - group of cpus sharing an RDT resource

Duplicate description here (same as rdt_hw_domain). Please use CPUs 
instead and resctrl instead of RDT.

> + * @list:		all instances of this resource
> + * @id:			unique id for this instance
> + * @cpu_mask:		which cpus share this resource
> + * @new_ctrl:		new ctrl value to be loaded
> + * @have_new_ctrl:	did user provide new_ctrl for this domain
> + * @rmid_busy_llc:	bitmap of which limbo RMIDs are above threshold
> + * @mbm_total:		saved state for MBM total bandwidth
> + * @mbm_local:		saved state for MBM local bandwidth
> + * @mbm_over:		worker to periodically read MBM h/w counters
> + * @cqm_limbo:		worker to periodically read CQM h/w counters
> + * @mbm_work_cpu:	worker cpu for MBM h/w counters
> + * @cqm_work_cpu:	worker cpu for CQM h/w counters
> + * @plr:		pseudo-locked region (if any) associated with domain
> + */

The above usages of cpu is what I considered earlier. I know that the 
x86 area prefers CPU but I also understand that you are just copying 
existing comments. I do not know if the x86 maintainers would require a 
change to CPU at this time but it seems like a good time to transition.

> +struct rdt_domain {
> +	struct list_head		list;
> +	int				id;
> +	struct cpumask			cpu_mask;
> +
> +	u32				new_ctrl;
> +	bool				have_new_ctrl;
> +
> +	unsigned long			*rmid_busy_llc;
> +	struct mbm_state		*mbm_total;
> +	struct mbm_state		*mbm_local;
> +	struct delayed_work		mbm_over;
> +	struct delayed_work		cqm_limbo;
> +	int				mbm_work_cpu;
> +	int				cqm_work_cpu;
> +
> +	struct pseudo_lock_region	*plr;
> +};
>   

Please remove the empty lines.

>   /**
>    * struct resctrl_cache - Cache allocation related data
> 

Reinette

  reply	other threads:[~2020-11-17 19:22 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-30 16:10 [PATCH 00/24] x86/resctrl: Merge the CDP resources James Morse
2020-10-30 16:10 ` [PATCH 01/24] x86/resctrl: Split struct rdt_resource James Morse
2020-11-17 19:20   ` Reinette Chatre
2021-03-12 17:10     ` James Morse
2020-10-30 16:10 ` [PATCH 02/24] x86/resctrl: Split struct rdt_domain James Morse
2020-11-17 19:22   ` Reinette Chatre [this message]
2020-10-30 16:10 ` [PATCH 03/24] x86/resctrl: Add resctrl_arch_get_num_closid() James Morse
2020-11-17 19:57   ` Reinette Chatre
2021-03-12 17:10     ` James Morse
2020-10-30 16:11 ` [PATCH 04/24] x86/resctrl: Add a separate schema list for resctrl James Morse
2020-11-17 21:29   ` Reinette Chatre
2021-03-12 17:10     ` James Morse
2020-10-30 16:11 ` [PATCH 05/24] x86/resctrl: Pass the schema in resdir's private pointer James Morse
2020-11-17 21:49   ` Reinette Chatre
2021-03-12 17:11     ` James Morse
2020-10-30 16:11 ` [PATCH 06/24] x86/resctrl: Store the effective num_closid in the schema James Morse
2020-11-17 22:04   ` Reinette Chatre
2021-03-12 17:13     ` James Morse
2020-10-30 16:11 ` [PATCH 07/24] x86/resctrl: Label the resources with their configuration type James Morse
2020-11-17 22:30   ` Reinette Chatre
2021-03-12 17:36     ` James Morse
2020-10-30 16:11 ` [PATCH 08/24] x86/resctrl: Walk the resctrl schema list instead of an arch list James Morse
2020-11-17 22:52   ` Reinette Chatre
2021-03-12 17:37     ` James Morse
2020-10-30 16:11 ` [PATCH 09/24] x86/resctrl: Change rdt_resource to resctrl_schema in pseudo_lock_region James Morse
2020-10-30 16:11 ` [PATCH 10/24] x86/resctrl: Move the schema names into struct resctrl_schema James Morse
2020-11-10 11:39   ` Jamie Iles
2020-11-11 18:11     ` James Morse
2020-11-17 23:11   ` Reinette Chatre
2021-03-12 17:38     ` James Morse
2020-10-30 16:11 ` [PATCH 11/24] x86/resctrl: Group staged configuration into a separate struct James Morse
2020-11-17 23:28   ` Reinette Chatre
2021-03-12 17:41     ` James Morse
2020-10-30 16:11 ` [PATCH 12/24] x86/resctrl: Add closid to the staged config James Morse
2020-11-17 23:46   ` Reinette Chatre
2021-03-12 17:43     ` James Morse
2020-10-30 16:11 ` [PATCH 13/24] x86/resctrl: Allow different CODE/DATA configurations to be staged James Morse
2020-11-18  0:30   ` Reinette Chatre
2020-10-30 16:11 ` [PATCH 14/24] x86/resctrl: Make update_domains() learn the affected closids James Morse
2020-10-30 16:11 ` [PATCH 15/24] x86/resctrl: Add a helper to read a closid's configuration James Morse
2020-10-30 16:11 ` [PATCH 16/24] x86/resctrl: Add a helper to read/set the CDP configuration James Morse
2020-10-30 16:11 ` [PATCH 17/24] x86/resctrl: Use cdp_enabled in rdt_domain_reconfigure_cdp() James Morse
2020-10-30 16:11 ` [PATCH 18/24] x86/resctrl: Pass configuration type to resctrl_arch_get_config() James Morse
2020-10-30 16:11 ` [PATCH 19/24] x86/resctrl: Make ctrlval arrays the same size James Morse
2020-10-30 16:11 ` [PATCH 20/24] x86/resctrl: Apply offset correction when config is staged James Morse
2020-10-30 16:11 ` [PATCH 21/24] x86/resctrl: Calculate the index from the configuration type James Morse
2020-10-30 16:11 ` [PATCH 22/24] x86/resctrl: Merge the ctrlval arrays James Morse
2020-10-30 16:11 ` [PATCH 23/24] x86/resctrl: Remove rdt_cdp_peer_get() James Morse
2020-10-30 16:11 ` [PATCH 24/24] x86/resctrl: Merge the CDP resources James Morse
2020-11-13 15:38 ` [PATCH 00/24] " Jamie Iles
2020-11-16 17:54 ` Reinette Chatre
2020-11-17 13:05   ` James Morse

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=768d3fe3-336f-70d6-d406-1d3f25b7f3bf@intel.com \
    --to=reinette.chatre@intel.com \
    --cc=bp@alien8.de \
    --cc=fenghua.yu@intel.com \
    --cc=james.morse@arm.com \
    --cc=jamie@nuviainc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=scott@os.amperecomputing.com \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=tglx@linutronix.de \
    --cc=x86@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;
as well as URLs for NNTP newsgroup(s).