Re: [PATCH v2 3/6] fs/resctrl: Make 'event_filter' files read only if they're not configurable

From: Ben Horgan

Date: Mon Mar 16 2026 - 13:02:24 EST


Hi Tony,

On 3/16/26 16:27, Luck, Tony wrote:
>>> Instead of making the file writable, and then fixing the mode. Maybe
>>> patch the mode in res_common_files[] before calling rdtgroup_add_files():
>>
>>
>> I initially rejected this idea because res_common_files[] is global and the
>> read/write choice is per event type but we can safely save restore the mode as
>> we're holding the rdtgroup mutex. How about this?
>
> That seems more complicated. Is there an expectation that event_filter
> needs to be writable on the "total" event but not on the "local" one?

No, at least not currently. For mpam only the total event is supported.

Another way of doing it could be to patch the mode in res_common_files[] from
resctrl_mkdir_event_configs() for both cases, 0444 and 0644, and change the
starting value to something invalid, e.g. 0.

Thanks,

Ben