Re: [PATCH v8 17/21] x86,fs/resctrl: Move the resctrl filesystem code to live in /fs/resctrl
From: James Morse
Date: Thu Apr 24 2025 - 13:09:25 EST
Hi Fenghua,
On 15/04/2025 00:21, Fenghua Yu wrote:
> This comment was buried in the middle of this huge patch.
>
> To see my previous comment easily, I cut all other irrelevant code.
(please do this as a matter of course! Anyone who needs more context can look at the
previous message)
> On 4/11/25 17:18, Fenghua Yu wrote:
>> On 4/11/25 09:42, James Morse wrote:
>>> Resctrl is a filesystem interface to hardware that provides cache
>>> allocation policy and bandwidth control for groups of tasks or CPUs.
>>>
>>> To support more than one architecture, resctrl needs to live in /fs/.
>>>
>>> Move the code that is concerned with the filesystem interface to
>>> /fs/resctrl.
>>> diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/
>>> rdtgroup.c
>>> index 326b3048d728..c7a7f0ae373a 100644
>>> --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
>>> +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
>
> [SNIP]
>
>>> -static int mkdir_rdt_prepare(struct kernfs_node *parent_kn,
>>> - const char *name, umode_t mode,
>>> - enum rdt_group_type rtype, struct rdtgroup **r)
>>> -{
>>> - struct rdtgroup *prdtgrp, *rdtgrp;
>>> - unsigned long files = 0;
>>> - struct kernfs_node *kn;
>>> - int ret;
>>> -
>>> - prdtgrp = rdtgroup_kn_lock_live(parent_kn);
>>> - if (!prdtgrp) {
>>> - ret = -ENODEV;
>>> - goto out_unlock;
>>> - }
>>> -
>>> - /*
>>> - * Check that the parent directory for a monitor group is a
>>> - * "mon_groups" directory.
> The follow is my previous original comment on the merge conflict and the fix:
>
>> Due to the slight difference between here and the upstream commit 45c2e30bbd64 ("x86/
>> resctrl: Fix rdtgroup_mkdir()'s unlocked use of kernfs_node::name"), merge conflicts.
>>
>> You may consider to add the following patch in patch #17 to fix the conflict?
>>
>> /*
>> - * Check that the parent directory for a monitor group is a "mon_groups"
>> - * directory.
>> + * Check that the parent directory for a monitor group is a
>> + * "mon_groups" directory.
>> */
This patch is generated by the python script that I previously posted - it will make these
changes when I rebase over the upstream'd version of patch 1.
Thanks,
James