Re: [PATCH v15 26/34] fs/resctrl: Add event configuration directory under info/L3_MON/

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Reinette,

On 7/18/25 17:20, Reinette Chatre wrote:
> Hi Babu,
> 
> On 7/17/25 8:54 PM, Reinette Chatre wrote:
>> Hi Babu,
>>
>> On 7/8/25 3:17 PM, Babu Moger wrote:
>>> diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
>>> index 15d10c346307..bb28ef7e4600 100644
>>> --- a/fs/resctrl/rdtgroup.c
>>> +++ b/fs/resctrl/rdtgroup.c
>>> @@ -86,6 +86,8 @@ enum resctrl_event_id mba_mbps_default_event;
>>>  
>>>  static bool resctrl_debug;
>>>  
>>> +extern struct mbm_transaction mbm_transactions[NUM_MBM_TRANSACTIONS];
>>> +
>>
>> Please move this extern to fs/resctrl/internal.h.
>>
>>>  void rdt_last_cmd_clear(void)
>>>  {
>>>  	lockdep_assert_held(&rdtgroup_mutex);
>>> @@ -1895,6 +1897,25 @@ static int resctrl_available_mbm_cntrs_show(struct kernfs_open_file *of,
>>>  	return ret;
>>>  }
>>>  
>>> +static int event_filter_show(struct kernfs_open_file *of, struct seq_file *seq, void *v)
>>> +{
>>> +	struct mon_evt *mevt = rdt_kn_parent_priv(of->kn);
>>> +	bool sep = false;
>>> +	int i;
>>> +
>>> +	for (i = 0; i < NUM_MBM_TRANSACTIONS; i++) {
>>> +		if (mevt->evt_cfg & mbm_transactions[i].val) {
>>
>> mevt->evt_cfg could possibly be changed concurrently. This should
>> be protected with the rdtgroup_mutex.
>>
>>> +			if (sep)
>>> +				seq_putc(seq, ',');
>>> +			seq_printf(seq, "%s", mbm_transactions[i].name);
>>> +			sep = true;
>>> +		}
>>> +	}
>>> +	seq_putc(seq, '\n');
>>> +
>>> +	return 0;
>>> +}
>>> +
>>>  /* rdtgroup information files for one cache resource. */
>>>  static struct rftype res_common_files[] = {
>>>  	{
>>> @@ -2019,6 +2040,12 @@ static struct rftype res_common_files[] = {
>>>  		.seq_show	= mbm_local_bytes_config_show,
>>>  		.write		= mbm_local_bytes_config_write,
>>>  	},
>>> +	{
>>> +		.name		= "event_filter",
>>> +		.mode		= 0444,
>>> +		.kf_ops		= &rdtgroup_kf_single_ops,
>>> +		.seq_show	= event_filter_show,
>>> +	},
>>>  	{
>>>  		.name		= "mbm_assign_mode",
>>>  		.mode		= 0444,
> 
> I am looking at the SDCIAE series now and it really looks like rdtgroup.c is
> becoming very large with code from various areas mixed in. In this series I
> requested several functions to be moved to monitor.c but generally did not
> highlight the main handlers added by this work. For example event_filter_show()
> added by this patch. For this work, could you please take a look if the
> handlers can also be moved to monitor.c? I think this will make things cleaner
> since the same helpers and data structures no longer need to be shared by multiple
> resctrl files. For example here, mbm_transactions[] can remain private
> to monitor.c where it is most relevant. In retrospect I think this is what
> we should have done for the BMEC work also.
> 

Sure. Will move event_filter_show() and event_filter_show().  Let me look
what other files to move.

-- 
Thanks
Babu Moger




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux