linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@intel.com>
To: Babu Moger <babu.moger@amd.com>, <corbet@lwn.net>,
	<tglx@linutronix.de>, <mingo@redhat.com>, <bp@alien8.de>
Cc: <fenghua.yu@intel.com>, <dave.hansen@linux.intel.com>,
	<x86@kernel.org>, <hpa@zytor.com>, <paulmck@kernel.org>,
	<akpm@linux-foundation.org>, <quic_neeraju@quicinc.com>,
	<rdunlap@infradead.org>, <damien.lemoal@opensource.wdc.com>,
	<songmuchun@bytedance.com>, <peterz@infradead.org>,
	<jpoimboe@kernel.org>, <pbonzini@redhat.com>,
	<chang.seok.bae@intel.com>, <pawan.kumar.gupta@linux.intel.com>,
	<jmattson@google.com>, <daniel.sneddon@linux.intel.com>,
	<sandipan.das@amd.com>, <tony.luck@intel.com>,
	<james.morse@arm.com>, <linux-doc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <bagasdotme@gmail.com>,
	<eranian@google.com>
Subject: Re: [PATCH v7 05/12] x86/resctrl: Detect and configure Slow Memory Bandwidth allocation
Date: Tue, 25 Oct 2022 16:43:50 -0700	[thread overview]
Message-ID: <c999a7f8-b083-72a6-ff07-201369339c92@intel.com> (raw)
In-Reply-To: <166604559954.5345.14619487558472213422.stgit@bmoger-ubuntu>

Hi Babu,

Nitpick in Subject ... "allocation" -> "Allocation"?

On 10/17/2022 3:26 PM, Babu Moger wrote:

...

> @@ -2845,7 +2846,8 @@ static int rdtgroup_init_alloc(struct rdtgroup *rdtgrp)
>  
>  	list_for_each_entry(s, &resctrl_schema_all, list) {
>  		r = s->res;
> -		if (r->rid == RDT_RESOURCE_MBA) {
> +		if (r->rid == RDT_RESOURCE_MBA ||
> +		    r->rid == RDT_RESOURCE_SMBA) {
>  			rdtgroup_init_mba(r, rdtgrp->closid);
>  			if (is_mba_sc(r))
>  				continue;

The above hunk and the ones that follow are unexpected.

Note that the software controller, when resctrl is mounted with "mba_MBps", is 
only supported by RDT_RESOURCE_MBA. At this time this really is hard coded all
over the place, for example:

static int set_mba_sc(bool mba_sc)
{
	struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_MBA].r_resctrl;
	...

}

Since SMBA hardcodes "delay_linear = false" I do not expect it to support the software
controller ... but these hunks appear to treat SMBA as though it does. It is the "MBA software
controller", not "SMBA software controller". Why does it check above if the MBA software
controller is enabled on SMBA?			

> @@ -3287,7 +3289,8 @@ void resctrl_offline_domain(struct rdt_resource *r, struct rdt_domain *d)
>  {
>  	lockdep_assert_held(&rdtgroup_mutex);
>  
> -	if (supports_mba_mbps() && r->rid == RDT_RESOURCE_MBA)
> +	if (supports_mba_mbps() &&
> +	    (r->rid == RDT_RESOURCE_MBA || r->rid == RDT_RESOURCE_SMBA))
>  		mba_sc_domain_destroy(r, d);
>  
>  	if (!r->mon_capable)
> @@ -3354,8 +3357,9 @@ int resctrl_online_domain(struct rdt_resource *r, struct rdt_domain *d)
>  
>  	lockdep_assert_held(&rdtgroup_mutex);
>  
> -	if (supports_mba_mbps() && r->rid == RDT_RESOURCE_MBA)
> -		/* RDT_RESOURCE_MBA is never mon_capable */
> +	if (supports_mba_mbps() &&
> +	    (r->rid == RDT_RESOURCE_MBA || r->rid == RDT_RESOURCE_MBA))
> +		/* RDT_RESOURCE_MBA (or SMBA) is never mon_capable */

What does this change do? Did you mean to add a r->rid == RDT_RESOURCE_SMBA check?

>  		return mba_sc_domain_allocate(r, d);
>  
>  	if (!r->mon_capable)
> 
> 

Why are the MBA software controller resources allocated/destroyed for a SMBA resource? If
you want to support the software controller for SMBA then there are a lot of other changes
missing.

Reinette

  reply	other threads:[~2022-10-25 23:44 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-17 22:25 [PATCH v7 00/12] x86/resctrl: Support for AMD QoS new features Babu Moger
2022-10-17 22:26 ` [PATCH v7 01/12] x86/cpufeatures: Add Slow Memory Bandwidth Allocation feature flag Babu Moger
2022-10-27 18:49   ` Reinette Chatre
2022-10-27 19:17     ` Moger, Babu
2022-10-17 22:26 ` [PATCH v7 02/12] x86/resctrl: Add a new resource type RDT_RESOURCE_SMBA Babu Moger
2022-10-17 22:26 ` [PATCH v7 03/12] x86/cpufeatures: Add Bandwidth Monitoring Event Configuration feature flag Babu Moger
2022-10-17 22:26 ` [PATCH v7 04/12] x86/resctrl: Include new features in command line options Babu Moger
2022-10-17 22:26 ` [PATCH v7 05/12] x86/resctrl: Detect and configure Slow Memory Bandwidth allocation Babu Moger
2022-10-25 23:43   ` Reinette Chatre [this message]
2022-10-26 19:07     ` Moger, Babu
2022-10-26 20:23       ` Reinette Chatre
2022-10-27 15:30         ` Moger, Babu
2022-10-27 18:37           ` Reinette Chatre
2022-10-28 15:16             ` Moger, Babu
2022-10-17 22:26 ` [PATCH v7 06/12] x86/resctrl: Introduce data structure to support monitor configuration Babu Moger
2022-10-25 23:45   ` Reinette Chatre
2022-10-26 19:25     ` Moger, Babu
2022-10-17 22:26 ` [PATCH v7 07/12] x86/resctrl: Add sysfs interface to read mbm_total_bytes event configuration Babu Moger
2022-10-25 23:47   ` Reinette Chatre
2022-10-26 19:36     ` Moger, Babu
2022-10-17 22:27 ` [PATCH v7 08/12] x86/resctrl: Add sysfs interface to read mbm_local_bytes " Babu Moger
2022-10-17 22:27 ` [PATCH v7 09/12] x86/resctrl: Add sysfs interface to write mbm_total_bytes " Babu Moger
2022-10-25 23:48   ` Reinette Chatre
2022-10-26 19:52     ` Moger, Babu
2022-10-17 22:27 ` [PATCH v7 10/12] x86/resctrl: Add sysfs interface to write mbm_local_bytes " Babu Moger
2022-10-17 22:27 ` [PATCH v7 11/12] x86/resctrl: Replace smp_call_function_many() with on_each_cpu_mask() Babu Moger
2022-10-17 22:27 ` [PATCH v7 12/12] Documentation/x86: Update resctrl.rst for new features Babu Moger
2022-10-18  3:24   ` Bagas Sanjaya
2022-10-25 23:50   ` Reinette Chatre
2022-10-26 20:00     ` Moger, Babu

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=c999a7f8-b083-72a6-ff07-201369339c92@intel.com \
    --to=reinette.chatre@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=babu.moger@amd.com \
    --cc=bagasdotme@gmail.com \
    --cc=bp@alien8.de \
    --cc=chang.seok.bae@intel.com \
    --cc=corbet@lwn.net \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=daniel.sneddon@linux.intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=eranian@google.com \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=james.morse@arm.com \
    --cc=jmattson@google.com \
    --cc=jpoimboe@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulmck@kernel.org \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=quic_neeraju@quicinc.com \
    --cc=rdunlap@infradead.org \
    --cc=sandipan.das@amd.com \
    --cc=songmuchun@bytedance.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --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).