|
From: Julian S. <js...@ac...> - 2012-11-20 22:22:56
|
On 11/20/2012 05:04 PM, Petar Jovanovic wrote: > We have been seeing some issues in which a program would end up in an infinite > loop due to SC failing each time. The probability to fail is closely related on > which compiler was used to compile Valgrind, but it will fail with any > eventually. With some native compilers, Valgrind always fails (i.e. stays in the > loop). Yes. I am not surprised to hear this. Because the JIT and the instrumentation adds arbitrary amounts of memory traffic between the original LL and SC, there must be some point at which it causes the LL-SC to fail in cases where the original guest-code LL-SC pair would have succeeded. Unfortunately I can't think of any easy way to avoid the problem. > A) leave RMW region in one translation block (i.e. if a branch is placed between > LL and SC, do not stop there) as long as it fits under max-size block; I don't think this would help. Whether or not the LL and SC are in the same block isn't important. The problem is that there are extra memory references in between the LL and SC that are not in the original code, and which cause the LL/SC to fail. J |