>>> On 19.12.16 at 17:38, <andrew.coop...@citrix.com> wrote:
> There is no need for the volatile cast in the timer interrupt.  pit0_ticks has
> external linkage, preventing the compiler from eliding the update.  This
> reduces the generated assembly from a read, local modify, write to a single
> add instruction.

I don't think external linkage is the reason here, considering the
effects of whole-program-optimization.

> --- a/xen/arch/x86/io_apic.c
> +++ b/xen/arch/x86/io_apic.c
> @@ -1485,8 +1485,7 @@ static int __init timer_irq_works(void)
>  {
>      unsigned long t1, flags;
>  
> -    t1 = pit0_ticks;
> -    mb();
> +    t1 = ACCESS_ONCE(pit0_ticks);

Any reason not to use the available read_atomic() here?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

Reply via email to