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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8b7ffd4b-6e04-4c3a-bcc4-33d72139414f@arm.com>
Date: Fri, 13 Sep 2024 19:07:42 +0100
From: James Morse <james.morse@....com>
To: Reinette Chatre <reinette.chatre@...el.com>, x86@...nel.org,
 linux-kernel@...r.kernel.org
Cc: Fenghua Yu <fenghua.yu@...el.com>, Thomas Gleixner <tglx@...utronix.de>,
 Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
 H Peter Anvin <hpa@...or.com>, Babu Moger <Babu.Moger@....com>,
 shameerali.kolothum.thodi@...wei.com,
 D Scott Phillips OS <scott@...amperecomputing.com>,
 carl@...amperecomputing.com, lcherian@...vell.com,
 bobo.shaobowang@...wei.com, tan.shaopeng@...itsu.com,
 baolin.wang@...ux.alibaba.com, Jamie Iles <quic_jiles@...cinc.com>,
 Xin Hao <xhao@...ux.alibaba.com>, peternewman@...gle.com,
 dfustini@...libre.com, amitsinght@...vell.com,
 David Hildenbrand <david@...hat.com>, Rex Nie <rex.nie@...uarmicro.com>,
 Dave Martin <dave.martin@....com>
Subject: Re: [PATCH v4 08/39] x86/resctrl: Generate default_ctrl instead of
 sharing it

Hi Reinette,

On 14/08/2024 05:00, Reinette Chatre wrote:
> On 8/2/24 10:28 AM, James Morse wrote:
> 
>> +/**
>> + * resctrl_get_default_ctrl() - Return the default control value for this
>> + *                              resource.
>> + * @r:        The resource whose default control type is queried.
>> + */
>> +static inline u32 resctrl_get_default_ctrl(struct rdt_resource *r)
>> +{
>> +    switch (r->schema_fmt) {
>> +    case RESCTRL_SCHEMA_BITMAP:
>> +        return BIT_MASK(r->cache.cbm_len) - 1;
>> +    case RESCTRL_SCHEMA_PERCENTAGE:
>> +        return 100u;
>> +    case RESCTRL_SCHEMA_MBPS:
>> +        return r->membw.max_bw;
>> +    }
>> +
>> +    return WARN_ON_ONCE(1);
>> +}
>> +

> I am concerned where this is headed. Since RESCTRL_SCHEMA_PERCENTAGE remains
> in use when resctrl is mounted with mba_MBps the default cannot always
> be 100u (it should be MBA_MAX_MBPS when software controller is active).

I agree - and we can certainly tidy that up.
But today when mba_sc is enable the bandwidth_gran and min-bandwidth files both report
'10' (%?), which isn't particularly meaningful.
I think these should both report '1'. There will be a minimum bandwidth, buts it not
something that can be discovered by the mba_sc code.

This was an oversight because the mba_sc mode doesn't update default_ctrl or the format
strings - it hijacks the parsing elsewhere. The default_ctrl isn't visible to user-space,
the value used when reading the schema file comes from the mbps_val array, instead of
ctrl_val.


Some of this has been booted over the horizon - I'll add straightening out the mba_sc
behaviour here to that list.



Thanks,

James

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ