On Wed, Nov 16, 2016 at 12:19:09PM +0800, Pan Xinhui wrote:yes, one more load in native case. I think this is acceptable as vcpu_is_preempted is not a critical function.
I think we can avoid a function call in a simpler way. How about below
static inline bool vcpu_is_preempted(int cpu)
/* only set in pv case*/
That is still more expensive. It needs to do an actual load and makes it
hard to predict the branch, you'd have to actually wait for the load to
Also, it generates more code.
Paravirt muck should strive to be as cheap as possible when ran on