On Fri, Feb 02, 2018 at 12:42:29PM +0100, Rafael J. Wysocki wrote:
> > > > But now that you made me look, intel_pstate_hwp_set() is horrible crap.
> > > > You should _never_ do things like:
> > > >
> > > > rdmsr_on_cpu()
> > > > /* frob value */
> > > > wrmsr_on_cpu()
> > > >
> > > > That's insane.
> > >
> > > I guess you mean it does too many IPIs? Or that it shouldn't do any IPIs
> > > at all?
> > Yes, too many synchronous IPIs, which themselves are typically already
> > more expensive than the MSR access.
> We could do all of the updates in one IPI (as Srinivas said), but it would be
> more code, and custom code for that matter.
> Is this really worth it for a slow path like this one?
Maybe it's a slow path at the moment but don't forget that one motivation
for this series is that HWP does not properly react when utilisation of a
CPU is artifically low because a task recently slept for IO or recently
migrated. In both cases, the task may be busy and sensitive to either
latency, throughput or both but HWP will use a low p-state. A standard
driver can do io-boost and while it currently does not do so, it could
also trivially do idle-boosting -- HWP does neither.