From: Greg KH <gregkh@linuxfoundation.org>
To: Babu Moger <babu.moger@amd.com>
Cc: fenghua.yu@intel.com, stable@vger.kernel.org, mingo@redhat.com,
bp@alien8.de, hpa@zytor.com, tglx@linutronix.de,
reinette.chatre@intel.com, x86@kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/resctrl: Fix memory bandwidth counter width for AMD
Date: Tue, 7 Jul 2020 16:04:50 +0200 [thread overview]
Message-ID: <20200707140450.GB4064836@kroah.com> (raw)
In-Reply-To: <159364160826.31030.7457664122034606608.stgit@bmoger-ubuntu>
On Wed, Jul 01, 2020 at 05:13:45PM -0500, Babu Moger wrote:
> [ Upstream commit 2c18bd525c47f882f033b0a813ecd09c93e1ecdf ]
>
> Memory bandwidth is calculated reading the monitoring counter
> at two intervals and calculating the delta. It is the software’s
> responsibility to read the count often enough to avoid having
> the count roll over _twice_ between reads.
>
> The current code hardcodes the bandwidth monitoring counter's width
> to 24 bits for AMD. This is due to default base counter width which
> is 24. Currently, AMD does not implement the CPUID 0xF.[ECX=1]:EAX
> to adjust the counter width. But, the AMD hardware supports much
> wider bandwidth counter with the default width of 44 bits.
>
> Kernel reads these monitoring counters every 1 second and adjusts the
> counter value for overflow. With 24 bits and scale value of 64 for AMD,
> it can only measure up to 1GB/s without overflowing. For the rates
> above 1GB/s this will fail to measure the bandwidth.
>
> Fix the issue setting the default width to 44 bits by adjusting the
> offset.
>
> AMD future products will implement CPUID 0xF.[ECX=1]:EAX.
>
> [ bp: Let the line stick out and drop {}-brackets around a single
> statement. ]
>
> Fixes: 4d05bf71f157 ("x86/resctrl: Introduce AMD QOS feature")
> Signed-off-by: Babu Moger <babu.moger@amd.com>
> Signed-off-by: Borislav Petkov <bp@suse.de>
> Link: https://lkml.kernel.org/r/159129975546.62538.5656031125604254041.stgit@naples-babu.amd.com
> ---
>
> Note:
> This commit is already queued for 5.7 stable kernel.
> Backporting it t 5.6 stable and older kernels now.
Now queued up to 5.4.y, thanks.
greg k-h
next prev parent reply other threads:[~2020-07-07 14:04 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-01 22:13 Babu Moger
2020-07-07 14:04 ` Greg KH [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-06-01 23:00 Babu Moger
2020-06-01 23:23 ` Fenghua Yu
2020-06-02 14:30 ` Babu Moger
2020-06-02 17:13 ` Reinette Chatre
2020-06-02 17:33 ` Babu Moger
2020-06-02 21:59 ` Reinette Chatre
2020-06-02 21:51 ` Reinette Chatre
2020-06-02 22:12 ` Babu Moger
2020-06-02 23:28 ` Reinette Chatre
2020-06-03 15:04 ` Babu Moger
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=20200707140450.GB4064836@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=babu.moger@amd.com \
--cc=bp@alien8.de \
--cc=fenghua.yu@intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=reinette.chatre@intel.com \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--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®