[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <64022abd-a798-c679-1c1d-eec9b18c4fb2@amd.com>
Date: Wed, 2 Oct 2019 14:45:03 +0000
From: "Natarajan, Janakarajan" <Janakarajan.Natarajan@....com>
To: Thomas Renninger <trenn@...e.de>,
"Natarajan, Janakarajan" <Janakarajan.Natarajan@....com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
Pu Wen <puwen@...on.com>, Shuah Khan <shuah@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Kate Stewart <kstewart@...uxfoundation.org>,
Allison Randal <allison@...utok.net>,
Richard Fontana <rfontana@...hat.com>,
Thomas Renninger <trenn@...e.com>, Borislav Petkov <bp@...e.de>
Subject: Re: [PATCH 1/2] Modify cpupower to schedule itself on cores it is
reading MSRs from
On 9/27/19 4:48 PM, Thomas Renninger wrote:
> On Friday, September 27, 2019 6:07:56 PM CEST Natarajan, Janakarajan wrote:
>> On 9/18/2019 11:34 AM, Natarajan, Janakarajan wrote:
>>> This is advantageous because an IPI is not generated when a read_msr() is
>>> executed on the local logical CPU thereby reducing the chance of having
>>> APERF and MPERF being out of sync.
>>> + if (sched_setaffinity(getpid(), sizeof(set), &set) == -1) {
>>> + dprint("Could not migrate to cpu: %d\n", cpu);
>>> + return 1;
> On a 80 core cpu the process would be pushed around through the
> system quite a lot.
> This might affect what you are measuring or the other measure values?
> Otherwise it's the kernel's MSR read only, not the whole cpupower process,
> right? No idea about the exact overhead, though. Others in CC list should
> know.
On a 256 logical-cpu Rome system we see C0 value from cpupower output go
from 0.01 to ~(0.1 to 1.00)
for all cpus with the 1st patch.
However, this goes down to ~0.01 when we use the RDPRU instruction
(which can be used to get
APERF/MPERF from CPL > 0) and avoid using the msr module (patch 2).
> Afaik msr reads through msr module should be avoided anyway?
> Those which are worth it are abstracted through sysfs nowadays?
>
> For aperf/mperf it might make sense to define a sysfs file where you
> can read both, as this is what you always need?
>
> It would take a while, but could be a longterm solution which is also
> usable in secure boot or without msr module case.
Yes. That is a good long term idea. An interface which could be used to
query APERF, MPERF
for a logical cpu in one go.
However, for systems that provide an instruction to get register values
from userspace, would a
command-line parameter be acceptable?
i.e. p: precise measurement.
When this is set, the cpupower process can migrate to each cpu and ,if
an instruction is available
which can get the APERF/MPERF from CPL > 0, use it. That would cut out
the msr module and the
overhead can be reduced.
Thanks.
> Thomas
>
>
>
Powered by blists - more mailing lists