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: <59b8c9e5-4394-4715-b9e2-90f99d4921fd@amd.com>
Date: Fri, 13 Dec 2024 09:23:57 -0600
From: "Moger, Babu" <bmoger@....com>
To: "Luck, Tony" <tony.luck@...el.com>, Babu Moger <babu.moger@....com>
Cc: corbet@....net, reinette.chatre@...el.com, tglx@...utronix.de,
 mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com,
 peternewman@...gle.com, fenghua.yu@...el.com, x86@...nel.org, hpa@...or.com,
 paulmck@...nel.org, akpm@...ux-foundation.org, thuth@...hat.com,
 rostedt@...dmis.org, xiongwei.song@...driver.com,
 pawan.kumar.gupta@...ux.intel.com, daniel.sneddon@...ux.intel.com,
 jpoimboe@...nel.org, perry.yuan@....com, andipan.das@....com,
 kai.huang@...el.com, xiaoyao.li@...el.com, seanjc@...gle.com,
 xin3.li@...el.com, andrew.cooper3@...rix.com, ebiggers@...gle.com,
 mario.limonciello@....com, james.morse@....com, tan.shaopeng@...itsu.com,
 linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
 maciej.wieczor-retman@...el.com, eranian@...gle.com
Subject: Re: [PATCH v10 23/24] x86/resctrl: Introduce interface to list
 assignment states of all the groups

Hi Tony,

On 12/12/2024 4:57 PM, Luck, Tony wrote:
> On Thu, Dec 12, 2024 at 02:15:26PM -0600, Babu Moger wrote:
>> +static int rdtgroup_mbm_assign_control_show(struct kernfs_open_file *of,
>> +					    struct seq_file *s, void *v)
>> +{
>> +	struct rdt_resource *r = of->kn->parent->priv;
>> +	struct rdt_mon_domain *dom;
>> +	struct rdtgroup *rdtg;
>> +	char str[10];
>> +
>> +	cpus_read_lock();
>> +	mutex_lock(&rdtgroup_mutex);
>> +	rdt_last_cmd_clear();
>> +
>> +	if (!resctrl_arch_mbm_cntr_assign_enabled(r)) {
>> +		rdt_last_cmd_puts("mbm_cntr_assign mode is not enabled\n");
>> +		mutex_unlock(&rdtgroup_mutex);
>> +		cpus_read_unlock();
>> +		return -EINVAL;
>> +	}
>> +
>> +	list_for_each_entry(rdtg, &rdt_all_groups, rdtgroup_list) {
>> +		struct rdtgroup *crg;
>> +
>> +		seq_printf(s, "%s//", rdtg->kn->name);
>> +
>> +		list_for_each_entry(dom, &r->mon_domains, hdr.list)
>> +			seq_printf(s, "%d=%s;", dom->hdr.id,
>> +				   rdtgroup_mon_state_to_str(r, dom, rdtg, str));
>> +		seq_putc(s, '\n');
> 
> Other resctrl files with domain lists use ';' as a separator, not a
> terminator. This code results in:
> 
> //0=tl;1=tl;
> 
> rather than
> 
> //0=tl;1=tl

Agree. Will correct it.

>> +
>> +		list_for_each_entry(crg, &rdtg->mon.crdtgrp_list,
>> +				    mon.crdtgrp_list) {
>> +			seq_printf(s, "%s/%s/", rdtg->kn->name, crg->kn->name);
>> +
>> +			list_for_each_entry(dom, &r->mon_domains, hdr.list)
>> +				seq_printf(s, "%d=%s;", dom->hdr.id,
>> +					   rdtgroup_mon_state_to_str(r, dom, crg, str));
>> +			seq_putc(s, '\n');
> 
> Ditto.

Sure.

> 
>> +		}
>> +	}
>> +
>> +	mutex_unlock(&rdtgroup_mutex);
>> +	cpus_read_unlock();
>> +	return 0;
>> +}
> 

thanks
Babu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ