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: <8a14e6d5-a1cd-2452-ebd5-e5031fba40d5@amd.com>
Date: Fri, 26 Jul 2024 18:53:19 -0500
From: "Moger, Babu" <bmoger@....com>
To: Peter Newman <peternewman@...gle.com>, Babu Moger <babu.moger@....com>
Cc: corbet@....net, fenghua.yu@...el.com, reinette.chatre@...el.com,
 tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
 dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com,
 paulmck@...nel.org, rdunlap@...radead.org, tj@...nel.org,
 peterz@...radead.org, yanjiewtw@...il.com, kim.phillips@....com,
 lukas.bulwahn@...il.com, seanjc@...gle.com, jmattson@...gle.com,
 leitao@...ian.org, jpoimboe@...nel.org, rick.p.edgecombe@...el.com,
 kirill.shutemov@...ux.intel.com, jithu.joseph@...el.com,
 kai.huang@...el.com, kan.liang@...ux.intel.com,
 daniel.sneddon@...ux.intel.com, pbonzini@...hat.com, sandipan.das@....com,
 ilpo.jarvinen@...ux.intel.com, maciej.wieczor-retman@...el.com,
 linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org, eranian@...gle.com,
 james.morse@....com
Subject: Re: [PATCH v5 09/20] x86/resctrl: Initialize monitor counters bitmap

Hi Peter,

On 7/26/2024 5:48 PM, Peter Newman wrote:
> Hi Babu,
> 
> On Wed, Jul 3, 2024 at 2:50 PM Babu Moger <babu.moger@....com> wrote:
>> diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
>> index 4f47f52e01c2..b3d3fa048f15 100644
>> --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
>> +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
>> @@ -185,6 +185,23 @@ bool closid_allocated(unsigned int closid)
>>          return !test_bit(closid, &closid_free_map);
>>   }
>>
>> +/*
>> + * Counter bitmap and its length for tracking available counters.
>> + * ABMC feature provides set of hardware counters for enabling events.
>> + * Each event takes one hardware counter. Kernel needs to keep track
>> + * of number of available counters.
>> + */
>> +static unsigned long mbm_cntrs_free_map;
>> +static unsigned int mbm_cntrs_free_map_len;
> 
> If counter assignment is supported at a per-domain granularity, then
> counter id allocation needs to be done per-domain rather than
> globally. For example, if I free a counter from one group in a
> particular domain, it should be available to allocate to another group
> only in that domain.

Yes. I noticed the problem.
> 
> When I attempt this using the current series, the resulting behavior
> is quite interesting. I noticed Reinette also commented on this later
> in the series, noticing that counters are only allocated permanently
> to groups and never move as a result of writing to mbm_control.

Working on fixing it right now.

We need to have bitmap at group level(global) as well as at domain 
level.  We need to set/clear bits at both the places when 
assigned/unassigned. If all the domsins are cleared then we need to free 
the counter at group level. Will address it v6. Thanks for the comments.

> 
> # grep 'g1[45]' info/L3_MON/mbm_control
> test/g14/0=tl;1=tl;2=tl;3=tl;4=tl;5=tl;6=tl;7=tl;8=tl;9=tl;10=tl;11=tl;12=tl;13=tl;14=tl;15=tl;16=tl;17=tl;18=tl;19=tl;20=tl;21=tl;22=tl;23=tl;24=tl;25=tl;26=tl;27=tl;28=tl;29=tl;30=tl;31=tl;
> test/g15/0=_;1=_;2=_;3=_;4=_;5=_;6=_;7=_;8=_;9=_;10=_;11=_;12=_;13=_;14=_;15=_;16=_;17=_;18=_;19=_;20=_;21=_;22=_;23=_;24=_;25=_;26=_;27=_;28=_;29=_;30=_;31=_;
> 
> [domains 2-31 omitted for clarity below]
> 
> # echo 'test/g14/1-t' > info/L3_MON/mbm_control
> # grep 'g1[45]' info/L3_MON/mbm_control
> test/g14/0=tl;1=l;
> test/g15/0=_;1=_;
> 
> # echo "test/g15/1+t" > info/L3_MON/mbm_control
> # grep 'g1[45]' info/L3_MON/mbm_control
> test/g14/0=tl;1=_;
> test/g15/0=_;1=_;
> 
> 
> -Peter
> 

-- 
- Babu Moger

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ