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] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.1803232221550.1481@nanos.tec.linutronix.de>
Date:   Fri, 23 Mar 2018 22:27:51 +0100 (CET)
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Eric Dumazet <edumazet@...gle.com>
cc:     x86 <x86@...nel.org>, lkml <linux-kernel@...r.kernel.org>,
        Eric Dumazet <eric.dumazet@...il.com>,
        "H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...hat.com>,
        Hugh Dickins <hughd@...gle.com>, Borislav Petkov <bp@...en8.de>
Subject: Re: [PATCH v2 1/2] x86, msr: add rdmsr_safe_on_cpu_resched() and
 use it in msr_read()

On Mon, 19 Mar 2018, Eric Dumazet 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.
> 
> This patch adds rdmsr_safe_on_cpu_resched() which does not spin.
> 
> I use this function from msr_read() but future patches might
> convert other callers to use this variant as well.
> 
> Overall daemon cpu usage was reduced by 35 %,
> and latencies caused by msr_read() disappeared.

Looking at all call sites. None of them is performance critical and all of
them are in preemptible context.

So we simply can switch the rdmsr_safe_on_cpu() implementation over to wait
mode completely.

> +/* Note: This version spins in smp_call_function_single().
> + * Consider using rdmsr_safe_on_cpu_resched() variant instead.

Bah. This is not networking code. x86 uses sensible comment style :)

Thanks,

	tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ