Re: [PATCH 2/2] PM / arch: x86: MSR_IA32_ENERGY_PERF_BIAS sysfs interface
From: Peter Zijlstra
Date: Fri Mar 22 2019 - 11:00:24 EST
On Thu, Mar 21, 2019 at 11:20:17PM +0100, Rafael J. Wysocki wrote:
> + ret = rdmsrl_on_cpu(cpu, MSR_IA32_ENERGY_PERF_BIAS, &epb);
> + if (ret < 0)
> + return ret;
> +
> + ret = wrmsrl_on_cpu(cpu, MSR_IA32_ENERGY_PERF_BIAS,
> + (epb & ~EPB_MASK) | val);
That's two back-to-back IPIs and a giant waste.
If you'd use a proper msr shadow variable, you'd not have to do the
rdmsr_on_cpu :-)