Re: panic_cpu should be volatile

2010-10-08 Thread John Baldwin
On Thursday, October 07, 2010 1:40:49 pm Andriy Gapon wrote: panic_cpu variable in kern_shutdown.c should be volatile otherwise it's cached in a register in the innermost while-loop in this code (observed on amd64 with base gcc and -O2): if (panic_cpu != PCPU_GET(cpuid)) while

panic_cpu should be volatile

2010-10-07 Thread Andriy Gapon
panic_cpu variable in kern_shutdown.c should be volatile otherwise it's cached in a register in the innermost while-loop in this code (observed on amd64 with base gcc and -O2): if (panic_cpu != PCPU_GET(cpuid)) while (atomic_cmpset_int(panic_cpu, NOCPU, PCPU_GET(cpuid)) == 0)