On 15.02.19 19:13, Julien Grall wrote:
Not really... This is an implementation details that does not matter
on the OS side.
And on hypervisor side?
If you want accurate number, then the NOW() macro is not sufficient
enough. Read to CNTPCTL_EL0 can occur speculatively and out of order
relative to other instructions executed on the same PE. So the PE can
potentially execute CNTPCTL_EL0 before update_runstate_area(...).
You would want to add an isb() at least before NOW() and potentially
after (unless you have register dependency).
I have a patch for adding an isb() in the NOW() macro. I will send it later
on.Good hint.
update_runstate_area(current);
+ if (current->domain->domain_id == 1)
+ printk("cp = %"PRI_stime"\n", NOW()-t);
That's only one number. Did you do an average over multiple context
switch (say 1000) ?
No, just got them on the console to see the numbers. They seems to not change
significantly during a minute run.
That's why I did not answer about context switches number.
I can do it in a bit more complicated way. But I do not expect I would
encounter differences.
--
Sincerely,
Andrii Anisov.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel