Re: [Xen-devel] [PATCH] xen: cache current vcpu

Jan Beulich
Tue, 30 Oct 2007 10:54:15 -0000

>>> Keir Fraser <Keir.Fraser@cl.cam.ac.uk> 29.10.07 18:23
>>>
>Gcc is quite capable of eliminating common subexpressions involving
>current(), ...

I have to partly disagree here: While gcc is capable of doing this, it cannot
do anything about uses of current that have function calls in between, and
I also don''t think making get_current() an __attribute__((__pure__))
inline
function would be correct.

I do agree that in certain places using current is more readable, albeit I
think that there are quite a few places where it is already non-obvious that
''v'' denotes ''current'' (perhaps naming might
just help here - if ''v'' only ever
gets set from ''current'' in a function, renaming it to
''cur'' might be reasonable
to consider).

Jan