lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <74f1b542-d489-4ff9-802c-5d6d5b8d50b4@amd.com>
Date: Tue, 22 Jul 2025 15:22:10 -0500
From: "Moger, Babu" <babu.moger@....com>
To: Reinette Chatre <reinette.chatre@...el.com>, corbet@....net,
 tony.luck@...el.com, james.morse@....com, tglx@...utronix.de,
 mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com
Cc: Dave.Martin@....com, x86@...nel.org, hpa@...or.com,
 akpm@...ux-foundation.org, paulmck@...nel.org, rostedt@...dmis.org,
 Neeraj.Upadhyay@....com, david@...hat.com, arnd@...db.de, fvdl@...gle.com,
 seanjc@...gle.com, jpoimboe@...nel.org, pawan.kumar.gupta@...ux.intel.com,
 xin@...or.com, manali.shukla@....com, tao1.su@...ux.intel.com,
 sohil.mehta@...el.com, kai.huang@...el.com, xiaoyao.li@...el.com,
 peterz@...radead.org, xin3.li@...el.com, kan.liang@...ux.intel.com,
 mario.limonciello@....com, thomas.lendacky@....com, perry.yuan@....com,
 gautham.shenoy@....com, chang.seok.bae@...el.com, linux-doc@...r.kernel.org,
 linux-kernel@...r.kernel.org, peternewman@...gle.com, eranian@...gle.com
Subject: Re: [PATCH v15 26/34] fs/resctrl: Add event configuration directory
 under info/L3_MON/

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ