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] [day] [month] [year] [list]
Message-ID: <538114ea-57fe-4553-962b-edbe331ef573@intel.com>
Date: Mon, 16 Sep 2024 15:34:28 -0700
From: Reinette Chatre <reinette.chatre@...el.com>
To: James Morse <james.morse@....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 James,

On 9/13/24 11:07 AM, James Morse wrote:
> 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.

Indeed. The complication with mba_sc is that it is a user facing MB/s solution implemented
by percentages in hardware.

> 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.

I understand that it may simplify the interface but please take care that the implementation
relies on these values to determine which percentage to use to accomplish a user
requested Mb/s.

> 
> 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.

Right.

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

Ack. I think it will be simpler for this work to focus on splitting existing
implementation. If clearing these up are a priority we can also work on it before
the split, but not as part of this change that I believe was intended to not
include functional changes.

Reinette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ