From: Ben Horgan <ben.horgan@arm.com>
To: "Luck, Tony" <tony.luck@intel.com>,
Reinette Chatre <reinette.chatre@intel.com>
Cc: james.morse@arm.com, Dave.Martin@arm.com, babu.moger@amd.com,
bp@alien8.de, tglx@linutronix.de, dave.hansen@linux.intel.com,
x86@kernel.org, hpa@zytor.com, fustini@kernel.org,
fenghuay@nvidia.com, peternewman@google.com,
linux-kernel@vger.kernel.org, patches@lists.linux.dev
Subject: Re: [PATCH 00/11] x86,fs/resctrl: Improve resctrl quality and consistency
Date: Wed, 4 Mar 2026 11:48:26 +0000 [thread overview]
Message-ID: <9f8aab1f-6e2e-4dad-9d6d-e70f5f909f04@arm.com> (raw)
In-Reply-To: <aaYfSTppsqwgMz1d@agluck-desk3>
Hi Tony,
On 3/2/26 23:37, Luck, Tony wrote:
> On Mon, Mar 02, 2026 at 10:46:06AM -0800, Reinette Chatre wrote:
>> Hi Everybody,
>>
>> This is a collection of resctrl cleanups assembled together for convenience
>> and simpler tracking. I'd be happy to split them up if it makes review and/or
>> handling easier.
>
> If it is time for spring cleaning in the rescctrl code, maybe fix some
> bad fir tree declarations too?
>
> Note resctrl_arch_pseudo_lock_fn() needs help too, but complicated by
> having #ifdef CONFIG_KASAN mixed in with declarations. It might need
> to remain an exception.
>
> -Tony
>
>
> From dd9c2ad1a1361b34e25fc10d18d3ceb3ba57fb92 Mon Sep 17 00:00:00 2001
> From: Tony Luck <tony.luck@intel.com>
> Date: Mon, 2 Mar 2026 15:28:36 -0800
> Subject: [PATCH] fs/resctrl: Clean up some bad "fir tree" declarations
>
> Sort local variables by length (longest first) per TIP tree.
>
> Signed-off-by: Tony Luck <tony.luck@intel.com>
> ---
> fs/resctrl/pseudo_lock.c | 2 +-
> fs/resctrl/rdtgroup.c | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/resctrl/pseudo_lock.c b/fs/resctrl/pseudo_lock.c
> index e1e9134474f4..cd57d862e0cf 100644
> --- a/fs/resctrl/pseudo_lock.c
> +++ b/fs/resctrl/pseudo_lock.c
> @@ -797,10 +797,10 @@ static const struct file_operations pseudo_measure_fops = {
> int rdtgroup_pseudo_lock_create(struct rdtgroup *rdtgrp)
> {
> struct pseudo_lock_region *plr = rdtgrp->plr;
> + char *kn_name __free(kfree) = NULL;
> struct task_struct *thread;
> unsigned int new_minor;
> struct device *dev;
> - char *kn_name __free(kfree) = NULL;
If you are changing this, I would expect either the declaration to come
lower at the allocation or alternatively drop the __free and do an
explict kfree. This is based on the guidance in include/linux/cleanup.h
""
* Given that the "__free(...) = NULL" pattern for variables defined at
* the top of the function poses this potential interdependency problem
* the recommendation is to always define and assign variables in one
* statement and not group variable definitions at the top of the
* function when __free() is used.
*
* Lastly, given that the benefit of cleanup helpers is removal of
* "goto", and that the "goto" statement can jump between scopes, the
* expectation is that usage of "goto" and cleanup helpers is never
* mixed in the same function. I.e. for a given routine, convert all
* resources that need a "goto" cleanup to scope-based cleanup, or
* convert none of them.
""
> int ret;
>
> ret = pseudo_lock_region_alloc(plr);
> diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
> index 0e93cecf6f30..b2ca6394714a 100644
> --- a/fs/resctrl/rdtgroup.c
> +++ b/fs/resctrl/rdtgroup.c
> @@ -3423,8 +3423,8 @@ static int mkdir_mondata_subdir(struct kernfs_node *parent_kn,
> static void mkdir_mondata_subdir_allrdtgrp(struct rdt_resource *r,
> struct rdt_domain_hdr *hdr)
> {
> - struct kernfs_node *parent_kn;
> struct rdtgroup *prgrp, *crgrp;
> + struct kernfs_node *parent_kn;
> struct list_head *head;
>
> list_for_each_entry(prgrp, &rdt_all_groups, rdtgroup_list) {
> @@ -3559,9 +3559,9 @@ static int __init_one_rdt_domain(struct rdt_ctrl_domain *d, struct resctrl_schem
> struct resctrl_staged_config *cfg;
> struct rdt_resource *r = s->res;
> u32 used_b = 0, unused_b = 0;
> + u32 peer_ctl, ctrl_val;
> unsigned long tmp_cbm;
> enum rdtgrp_mode mode;
> - u32 peer_ctl, ctrl_val;
> int i;
>
> cfg = &d->staged_config[t];
Thanks,
Ben
next prev parent reply other threads:[~2026-03-04 11:48 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-02 18:46 [PATCH 00/11] x86,fs/resctrl: Improve resctrl quality and consistency Reinette Chatre
2026-03-02 18:46 ` [PATCH 01/11] fs/resctrl: Add missing return value descriptions Reinette Chatre
2026-03-02 18:46 ` [PATCH 02/11] fs/resctrl: Avoid "may be used uninitialized" warning Reinette Chatre
2026-03-02 18:46 ` [PATCH 03/11] fs/resctrl: Use correct format specifier for printing error pointers Reinette Chatre
2026-03-02 18:46 ` [PATCH 04/11] x86/resctrl: Protect against bad shift Reinette Chatre
2026-03-02 18:46 ` [PATCH 05/11] fs/resctrl: Use accurate type for rdt_resource::rid Reinette Chatre
2026-03-03 18:20 ` Luck, Tony
2026-03-03 19:06 ` Reinette Chatre
2026-03-03 19:54 ` Luck, Tony
2026-03-03 22:29 ` Reinette Chatre
2026-03-03 23:26 ` Luck, Tony
2026-03-17 11:23 ` Ben Horgan
2026-03-17 17:34 ` Reinette Chatre
2026-03-02 18:46 ` [PATCH 06/11] fs/resctrl: Pass error reading event through to user space Reinette Chatre
2026-03-17 17:08 ` Ben Horgan
2026-03-02 18:46 ` [PATCH 07/11] fs/resctrl: Add last_cmd_status support for writes to max_threshold_occupancy Reinette Chatre
2026-03-17 17:13 ` Ben Horgan
2026-03-02 18:46 ` [PATCH 08/11] fs/resctrl: Use accurate and symmetric exit flows Reinette Chatre
2026-03-02 18:46 ` [PATCH 09/11] fs/resctrl: Use stricter checks on input to cpus/cpus_list file Reinette Chatre
2026-03-02 18:46 ` [PATCH 10/11] fs/resctrl: Change last_cmd_status custom during input parsing Reinette Chatre
2026-03-17 17:20 ` Ben Horgan
2026-03-02 18:46 ` [PATCH 11/11] fs/resctrl: Communicate resource group deleted error via last_cmd_status Reinette Chatre
2026-03-02 23:37 ` [PATCH 00/11] x86,fs/resctrl: Improve resctrl quality and consistency Luck, Tony
2026-03-03 2:18 ` Reinette Chatre
2026-03-04 11:48 ` Ben Horgan [this message]
2026-03-16 22:28 ` Reinette Chatre
2026-03-16 17:44 ` Ben Horgan
2026-03-16 18:18 ` Reinette Chatre
2026-03-17 10:25 ` Ben Horgan
2026-03-17 18:09 ` Reinette Chatre
2026-03-18 11:59 ` Ben Horgan
2026-03-18 16:35 ` Reinette Chatre
2026-03-18 17:10 ` Ben Horgan
2026-03-18 20:12 ` Reinette Chatre
2026-03-19 9:53 ` Ben Horgan
2026-03-19 16:18 ` Reinette Chatre
2026-03-19 17:18 ` Ben Horgan
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=9f8aab1f-6e2e-4dad-9d6d-e70f5f909f04@arm.com \
--to=ben.horgan@arm.com \
--cc=Dave.Martin@arm.com \
--cc=babu.moger@amd.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=fenghuay@nvidia.com \
--cc=fustini@kernel.org \
--cc=hpa@zytor.com \
--cc=james.morse@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@lists.linux.dev \
--cc=peternewman@google.com \
--cc=reinette.chatre@intel.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