Messages in this thread | | | Date | Tue, 21 Dec 2010 16:43:24 -0600 (CST) | From | Christoph Lameter <> | Subject | Re: acpi throttling: Use this_cpu_has and simplify code |
| |
On Sat, 18 Dec 2010, Tejun Heo wrote:
> It's bothersome that these methods don't have any indication that > they're bound to local CPU when they can't be called with @pr for > another CPU as MSRs can only be accessed from local CPU.
Right.
> In the longer run, it would be nice if there's an indication that this > is only for the local CPU and maybe a WARN_ON_ONCE(). Maybe dropping > @pr and using this_cpu_*() is better for performance too?
That is precisely the difficulty with many other functions that take pointers to cpu_info. If we can establish that they are called *only* with pointers to the current cpu then we can improve the function by dropping the parameter and using this_cpu ops to access the cpu_info fields.
Using this_cpu ops instead of access to a field of a struct pointed to by an array avoids an addition of pointers and replacest with a operation that essentially takes a global address with a segment prefix. It reduces register pressure and avoids the additions of pointers but it will encode the address in the instruction.
| |