Re: [PATCH v12 20/31] fs/resctrl: Refactor mkdir_mondata_subdir()

From: Reinette Chatre

Date: Tue Oct 28 2025 - 19:55:27 EST


Hi Tony,

On 10/28/25 11:40 AM, Luck, Tony wrote:
> On Tue, Oct 28, 2025 at 10:40:44AM -0700, Reinette Chatre wrote:
>> Modifying mon_add_all_files() sounds good. I assume the node activation (kernfs_active())
>> will still be done by the caller which would have this new function return a struct kernfs_node *?
>> If so, I think it will make code easier to read if name implies that a new kn is created.
>> Since the caller is already mkdir_mondata_subdir(), what do you think of _mkdir_mondata_subdir()?
>
> Reinette,
>
> This section of fs/resctrl/rdtgroup.c now looks like this. Call sites
> are now free of duplicated code. Thanks for the nudge to do this.
>

>
> /*
> * Create a directory for a domain and populate it with monitor files.

Could you please add a short snippet about the different meanings of @hdr? It does not
have to be entirely kernel-doc style, just a note for the developer trying to understand
this function. Something like: "Create summing monitors when @hdr is NULL. No need to
initialize summing monitors."

> */

...

I find this new version much easier to parse. Thank you very much.

Reinette