mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@intel.com>
To: Tony Luck <tony.luck@intel.com>,
	Fenghua Yu <fenghua.yu@intel.com>,
	"Maciej Wieczor-Retman" <maciej.wieczor-retman@intel.com>,
	Peter Newman <peternewman@google.com>,
	James Morse <james.morse@arm.com>,
	Babu Moger <babu.moger@amd.com>,
	Drew Fustini <dfustini@baylibre.com>,
	Dave Martin <Dave.Martin@arm.com>, Borislav Petkov <bp@alien8.de>,
	Martin Kletzander <nert.pinx@gmail.com>
Cc: <x86@kernel.org>, <linux-kernel@vger.kernel.org>,
	<patches@lists.linux.dev>
Subject: Re: [PATCH] x86/resctrl: Do not round up mba_MBps values in schemata file
Date: Fri, 27 Sep 2024 15:46:46 -0700	[thread overview]
Message-ID: <623a4a0d-b479-4bfe-9c2b-b62584a19738@intel.com> (raw)
In-Reply-To: <20240927223038.41198-1-tony.luck@intel.com>

+Martin

Hi Tony,

On 9/27/24 3:30 PM, Tony Luck wrote:
> When the mba_MBps mount option is used Linux initializes the
> MBA control values in the schemata file to MBA_MAX_MBPS (which
> is defined as U32_MAX). So the schemata file contains this line:
> 
>  MB:0=4294967295;1=4294967295
> 
> If a user edits the schemata file with vi(1) (or other editor) and
> simply writes that line back, it gets changed to:
> 
>   MB:0=   4;1=   4
> 
> which sets maximum bandwidth to a very low value.
> 
> This happens because bw_validate() unconditionally rounds user supplied
> values up to next multiple of r->membw.bw_gran. That results in a value
> that will not fit into d->mbps_val[closid].
> 
> Rounding up only makes sense when mba_MBps is not enabled and control
> values are expressed as percentage values.
> 
> Skip the roundup() when mba_MBps is enabled.
> 
> Signed-off-by: Tony Luck <tony.luck@intel.com>
> ---

A fix for this issue is already being discussed. Please see latest fix
at [1] that additionally addresses the issue if a user attempts to 
write a value larger than 4294967295. Could you please check if that
fix works for you?

Thank you.

Reinette

[1] https://lore.kernel.org/all/a7c80676-0761-4618-ac07-0b53434b1a9b@intel.com/


  reply	other threads:[~2024-09-27 22:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-27 22:30 Tony Luck
2024-09-27 22:46 ` Reinette Chatre [this message]
2024-09-27 23:03   ` Luck, Tony

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=623a4a0d-b479-4bfe-9c2b-b62584a19738@intel.com \
    --to=reinette.chatre@intel.com \
    --cc=Dave.Martin@arm.com \
    --cc=babu.moger@amd.com \
    --cc=bp@alien8.de \
    --cc=dfustini@baylibre.com \
    --cc=fenghua.yu@intel.com \
    --cc=james.morse@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.wieczor-retman@intel.com \
    --cc=nert.pinx@gmail.com \
    --cc=patches@lists.linux.dev \
    --cc=peternewman@google.com \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®