From: "Moger, Babu" <babu.moger@amd.com>
To: Reinette Chatre <reinette.chatre@intel.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,
christophe.leroy@csgroup.eu, jarkko@kernel.org,
adrian.hunter@intel.com, quic_jiles@quicinc.com,
peternewman@google.com
Subject: Re: [PATCH v3 4/7] x86/resctrl: Re-arrange RFTYPE flags based on hierarchy
Date: Tue, 21 Mar 2023 10:54:48 -0500 [thread overview]
Message-ID: <c083cfb4-3282-2aeb-c704-9cc21ada918e@amd.com> (raw)
In-Reply-To: <26400c6a-dcde-9ac2-df7a-117a12875f0c@intel.com>
Hi Reinette,
To be honest, I had tough time understanding these flags. Also, I need to
add more files in the future. So, I am trying make these these things
clear before I do those changes.
These flags decoding is pretty confusing. Also, there are some flags which
are duplicate. Not really required.
For example:
In group structure, we have control group or mon group. We just need two
bits here. The code uses combination of 3 flags here.
#define RFTYPE_BASE BIT(1)
#define RFTYPE_CTRL BIT(4)
#define RFTYPE_MON BIT(5)
Also, the flag RFTYPE_MON again used in creation on info directory.
Basically, very confusing to add anything new.
I will try to minimize the changes in the next version but still make it
clear.
On 3/15/23 13:37, Reinette Chatre wrote:
> Hi Babu,
>
> On 3/2/2023 12:24 PM, Babu Moger wrote:
>> RESCTRL filesystem has two main components:
>> a. info (Details on resources and monitoring)
>> b. base (Details on CONTROL and MON groups)
>>
>> The rftype flags can be renamed accordingly for better understanding.
>> For example:
>> RFTYPE_INFO : Files with these flags go in info directory
>
> This is not a rename but the current name.
Agree. I am giving some example here. I may not need to change the text here.
>
>> RFTYPE_INFO_MON : Files with these flags go in info/L3_MON
>
> How does this improve the current RFTYPE_MON_INFO?
RFTYPE_INFO_MON -> info/L3_MON.
I tried to improve some readability based on hierarchy. Basically, looking
at the flags we know exaclty where these files land.
>
>> RFTYPE_BASE : Files with these flags go in group's(control or mon)
>> base directory
> This is not a rename but the current name.
>
>> RFTYPE_BASE_CTRL: Files with these flags go in only CONTROL groups
>
> How does this improve current RFTYPE_CTRL_BASE ?
Again, same explanation as above. Started with RFTYPE_BASE and added
RFTYPE_BASE_CTRL to say these files are on top of base.
>
>>
>> Add comments to make it easy for future additions.
>>
>> Signed-off-by: Babu Moger <babu.moger@amd.com>
>> ---
>> arch/x86/kernel/cpu/resctrl/core.c | 8 ++--
>> arch/x86/kernel/cpu/resctrl/internal.h | 64 ++++++++++++++++++++++++++++----
>> arch/x86/kernel/cpu/resctrl/rdtgroup.c | 44 +++++++++++-----------
>> 3 files changed, 81 insertions(+), 35 deletions(-)
>>
>> diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
>> index 030d3b409768..d1c6b2cc8611 100644
>> --- a/arch/x86/kernel/cpu/resctrl/core.c
>> +++ b/arch/x86/kernel/cpu/resctrl/core.c
>> @@ -69,7 +69,7 @@ struct rdt_hw_resource rdt_resources_all[] = {
>> .domains = domain_init(RDT_RESOURCE_L3),
>> .parse_ctrlval = parse_cbm,
>> .format_str = "%d=%0*x",
>> - .fflags = RFTYPE_RES_CACHE,
>> + .fflags = RFTYPE_CACHE,
>> },
>
> How does this rename improve understanding?
Agree. This change may not be required. I can actually remove these changes
>
> ...
>
>> @@ -97,7 +97,7 @@ struct rdt_hw_resource rdt_resources_all[] = {
>> .domains = domain_init(RDT_RESOURCE_MBA),
>> .parse_ctrlval = parse_bw,
>> .format_str = "%d=%*u",
>> - .fflags = RFTYPE_RES_MB,
>> + .fflags = RFTYPE_MB,
>> },
>> },
>> [RDT_RESOURCE_SMBA] =
>
> ditto.
Agree. This change may not be required. I can actually remove these changes
.
>
>
> ...
>
>> + *
>> */
>> #define RFTYPE_INFO BIT(0)
>> #define RFTYPE_BASE BIT(1)
>> -#define RFTYPE_CTRL BIT(4)
>> -#define RFTYPE_MON BIT(5)
>> -#define RFTYPE_TOP BIT(6)
>> -#define RFTYPE_RES_CACHE BIT(8)
>> -#define RFTYPE_RES_MB BIT(9)
>> -#define RFTYPE_CTRL_INFO (RFTYPE_INFO | RFTYPE_CTRL)
>> -#define RFTYPE_MON_INFO (RFTYPE_INFO | RFTYPE_MON)
>> -#define RFTYPE_TOP_INFO (RFTYPE_INFO | RFTYPE_TOP)
>> -#define RFTYPE_CTRL_BASE (RFTYPE_BASE | RFTYPE_CTRL)
>> +
>> +#define RFTYPE_TOP BIT(2)
>> +#define RFTYPE_MON BIT(3)
>> +#define RFTYPE_RES BIT(4)
>> +
>> +#define RFTYPE_CACHE BIT(5)
>> +#define RFTYPE_MB BIT(6)
>> +
>> +#define RFTYPE_CTRL BIT(8)
>> +
>> +#define RFTYPE_INFO_TOP (RFTYPE_INFO | RFTYPE_TOP)
>> +#define RFTYPE_INFO_MON (RFTYPE_INFO | RFTYPE_MON)
>> +#define RFTYPE_INFO_RES (RFTYPE_INFO | RFTYPE_RES)
>> +
>> +#define RFTYPE_BASE_CTRL (RFTYPE_BASE | RFTYPE_CTRL)
>>
>
> It is not clear to me how any of the renames improves understanding.
>
> How does renaming RFTYPE_CTRL_BASE to RFTYPE_BASE_CTRL improve
> understanding? Renaming RFTYPE_MON_INFO to RFTYPE_INFO_MON?
>
> This all seems unnecessary.
Again see my comments in the beginning.
>
> ...
>
>> @@ -3218,7 +3218,7 @@ static int mkdir_rdt_prepare(struct kernfs_node *parent_kn,
>> if (rtype == RDTCTRL_GROUP)
>> fflags = RFTYPE_BASE | RFTYPE_CTRL;
>> else
>> - fflags = RFTYPE_BASE | RFTYPE_MON;
>> + fflags = RFTYPE_BASE;
>>
>
> Is this intended?
Yes. We don't need this extra flag (RFTYPE_MON) here.
Thanks
Babu Moger
next prev parent reply other threads:[~2023-03-21 15:55 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-02 20:24 [PATCH v3 0/7] x86/resctrl: Miscellaneous resctrl features Babu Moger
2023-03-02 20:24 ` [PATCH v3 1/7] x86/resctrl: Add multiple tasks to the resctrl group at once Babu Moger
2023-03-15 18:32 ` Reinette Chatre
2023-03-16 16:27 ` Moger, Babu
2023-03-16 17:12 ` Reinette Chatre
2023-03-16 19:51 ` Moger, Babu
2023-03-16 20:33 ` Reinette Chatre
2023-03-20 15:07 ` Moger, Babu
2023-03-20 15:15 ` Moger, Babu
2023-03-20 16:52 ` Reinette Chatre
2023-03-20 18:29 ` Moger, Babu
2023-03-02 20:24 ` [PATCH v3 2/7] x86/resctrl: Remove few unnecessary rftype flags Babu Moger
2023-03-15 18:33 ` Reinette Chatre
2023-03-16 20:31 ` Moger, Babu
2023-03-16 20:41 ` Reinette Chatre
2023-03-16 21:11 ` Moger, Babu
2023-03-16 21:17 ` Reinette Chatre
2023-03-20 13:35 ` Moger, Babu
2023-03-02 20:24 ` [PATCH v3 3/7] x86/resctrl: Rename rftype flags for consistency Babu Moger
2023-03-02 20:24 ` [PATCH v3 4/7] x86/resctrl: Re-arrange RFTYPE flags based on hierarchy Babu Moger
2023-03-15 18:37 ` Reinette Chatre
2023-03-21 15:54 ` Moger, Babu [this message]
2023-03-22 18:46 ` Reinette Chatre
2023-03-02 20:24 ` [PATCH v3 5/7] x86/resctrl: Display the RMID and COSID for resctrl groups Babu Moger
2023-03-15 18:42 ` Reinette Chatre
2023-03-20 16:52 ` Moger, Babu
2023-03-20 17:00 ` Reinette Chatre
2023-03-20 17:10 ` James Morse
2023-03-20 19:53 ` Moger, Babu
2023-03-20 20:59 ` Stephane Eranian
2023-03-22 13:49 ` Moger, Babu
2023-03-02 20:25 ` [PATCH v3 6/7] x86/resctrl: Introduce -o debug mount option Babu Moger
2023-03-15 18:43 ` Reinette Chatre
2023-03-22 14:01 ` Moger, Babu
2023-03-02 20:25 ` [PATCH v3 7/7] x86/resctrl: Add debug files when mounted with debug option Babu Moger
2023-03-15 18:45 ` Reinette Chatre
2023-03-22 15:09 ` 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=c083cfb4-3282-2aeb-c704-9cc21ada918e@amd.com \
--to=babu.moger@amd.com \
--cc=adrian.hunter@intel.com \
--cc=akpm@linux-foundation.org \
--cc=bagasdotme@gmail.com \
--cc=bp@alien8.de \
--cc=chang.seok.bae@intel.com \
--cc=christophe.leroy@csgroup.eu \
--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=jarkko@kernel.org \
--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=peternewman@google.com \
--cc=peterz@infradead.org \
--cc=quic_jiles@quicinc.com \
--cc=quic_neeraju@quicinc.com \
--cc=rdunlap@infradead.org \
--cc=reinette.chatre@intel.com \
--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
all inboxes | Powered by JetHome®