From: Eric Dumazet <eric.dumazet@gmail.com>
To: Ingo Molnar <mingo@kernel.org>, Eric Dumazet <edumazet@google.com>
Cc: x86 <x86@kernel.org>, lkml <linux-kernel@vger.kernel.org>,
"H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Hugh Dickins <hughd@google.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [PATCH v3 1/2] x86, msr: allow rdmsr_safe_on_cpu() to schedule
Date: Sat, 24 Mar 2018 07:29:48 -0700 [thread overview]
Message-ID: <336355a3-c11d-44fc-0642-671670980ac0@gmail.com> (raw)
In-Reply-To: <20180324080946.3db4xdkl5i6jx2rc@gmail.com>
On 03/24/2018 01:09 AM, Ingo Molnar wrote:
>
> * Eric Dumazet <edumazet@google.com> wrote:
>
>> I noticed high latencies caused by a daemon periodically reading
>> various MSR on all cpus. KASAN kernels would see ~10ms latencies
>> simply reading one MSR. Even without KASAN, sending IPI to CPU
>> in deep sleep state or blocking hard IRQ in a a long section,
>> then waiting for the answer can consume hundreds of usec.
>>
>> Converts rdmsr_safe_on_cpu() to use a completion instead
>> of busy polling.
>>
>> Overall daemon cpu usage was reduced by 35 %,
>> and latencies caused by msr_read() disappeared.
>
> What "daemon" is this and why is it reading MSRs?
It is named gsysd, "Google System Tool", a daemon+cli that is run
on all machines in production to provide a generic interface
for interacting with the system hardware.
I am not sure if this answers your question, I probably
could give a rough estimation of MWh this daemon consumes on the planet
if that helps.
Note that the source of the problem is not reading the MSR, but having cpus
blocking hard irqs for a long time.
Ingo, it looks like any loop protected by unlock_task_sighand() might be the main
offender.
Application writers seem to love getrusage() for example.
Can we rewrite it to not block hard irqs ?
Thanks !
next prev parent reply other threads:[~2018-03-24 14:29 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-23 21:58 [PATCH v3 1/2] x86, msr: allow rdmsr_safe_on_cpu() to schedule Eric Dumazet
2018-03-23 21:58 ` [PATCH v3 2/2] x86, cpuid: allow cpuid_read() " Eric Dumazet
2018-03-23 22:17 ` H. Peter Anvin
2018-03-24 1:01 ` Eric Dumazet
2018-03-25 22:11 ` H. Peter Anvin
2018-03-27 10:10 ` [tip:x86/cleanups] x86/cpuid: Allow " tip-bot for Eric Dumazet
2018-03-24 8:09 ` [PATCH v3 1/2] x86, msr: allow rdmsr_safe_on_cpu() " Ingo Molnar
2018-03-24 10:50 ` Thomas Gleixner
2018-03-24 14:29 ` Eric Dumazet [this message]
2018-03-25 14:12 ` Borislav Petkov
2018-03-26 1:21 ` H. Peter Anvin
2018-03-26 6:40 ` Ingo Molnar
[not found] ` <CANn89iKy_jVpBvAebJFm1UKVKfG=p+R4B1tXmC4waeK7YzZh2g@mail.gmail.com>
2018-03-26 14:23 ` Thomas Gleixner
2018-03-27 9:36 ` Ingo Molnar
2018-03-27 10:10 ` [tip:x86/cleanups] x86/msr: Allow " tip-bot for Eric Dumazet
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=336355a3-c11d-44fc-0642-671670980ac0@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=a.p.zijlstra@chello.nl \
--cc=bp@alien8.de \
--cc=edumazet@google.com \
--cc=hpa@zytor.com \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--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