A tale of an impossible bug: big.LITTLE and caching
11–20 of 116 posts
Re: A tale of an impossible bug: big.LITTLE and caching
#12Earlier quoted context omitted.
Stupid question but does that work in a virtualised environment where your program can be live-migrated to another physical machine with a different CPU?
Nope. There's not really any alternative other than "Don't do that", or limit migration to machines that have a superset of the instructions on the original machine.
Re: A tale of an impossible bug: big.LITTLE and caching
#13https://gcc.gnu.org/ml/gcc-patches/2012-09/msg00076.html
Prior to that, the call:
asm volatile ("mrs\t%0, ctr_el0":"=r" (cache_info));
was always made.Re: A tale of an impossible bug: big.LITTLE and caching
#14Earlier quoted context omitted.
Performance. get_current_cpu_cache_line_size would need to run some code to determine the cache line size, and that code takes longer to run than using a cached value. Along similar lines, if you have an optimized routine using specific CPU instructions, you don't want to call CPUID (or equivalent) on every call to find out if you have those instructions; you want to call it once and cache the answer. If it can retur…
Stupid question but does that work in a virtualised environment where your program can be live-migrated to another physical machine with a different CPU?
You'll choose a lowest common denominator of features sets.
Re: A tale of an impossible bug: big.LITTLE and caching
#15From the pseudo code, what is disadvantage that making get_current_cpu_cache_line_size() always get called?
The only real fix is to do what they are doing -- always use the smallest line size of the system, regardless of which core you are running on.
Re: A tale of an impossible bug: big.LITTLE and caching
#16One question about the intro, which states that this is the first mass produced AMP architecture, but isn't the PlayStation 3's Cell CPU one?
Re: A tale of an impossible bug: big.LITTLE and caching
#17Earlier quoted context omitted.
Stupid question but does that work in a virtualised environment where your program can be live-migrated to another physical machine with a different CPU?
Nope. There's not really any alternative other than "Don't do that", or limit migration to machines that have a superset of the instructions on the original machine.
Re: A tale of an impossible bug: big.LITTLE and caching
#18Re: A tale of an impossible bug: big.LITTLE and caching
#19It appears the that the caching code was added in this patch: https://gcc.gnu.org/ml/gcc-patches/2012-09/msg00076.html Prior to that, the call: asm volatile ("mrs\t%0, ctr_el0":"=r" (cache_info)); was always made.
The big cores should report the smaller cache line size always.
Re: A tale of an impossible bug: big.LITTLE and caching
#20Earlier quoted context omitted.
That's a question for the libgcc team. I seriously doubt it to be slow enough to matter.
it reads some coproc regs, which are instructions that cannot be reordered. they slow down everything on an OOO core. after that just some bitmasking (not slow)
(This is all documented in the v8 ARM ARM section "Synchronization requirements for AArch64 System Registers".)