[PTLsim-devel] Simulator livelocks on while aquiring the lock

Srđan Stipić
Tue Nov 6 09:58:09 EST 2007


Hi.

I am running PTLSim (r219) with 4 simulated smtcores.
In my test program, I fork 4 threads that try to acquire the same lock.
Afters some time simulation stops (livelocks) on the instruction with the
address 0x45a775.
This can be seen from the log:
Completed       4141384 cycles,       2935184 commits:    109269
cycles/sec,     29379, insns/sec: rip 0x45a775 0x45a775 0x45a775 0x45a775
Completed       4163250 cycles,       2941048 commits:    109329
cycles/sec,     29319, insns/sec: rip 0x45a775 0x45a775 0x45a775 0x45a775
Completed       4185117 cycles,       2946904 commits:    109329
cycles/sec,     29278, insns/sec: rip 0x45a775 0x45a775 0x45a775 0x45a775

Is there any particular reason why non of the threads are able to acquire
the lock?

Tnx,
Srdjan

P.S.
The code that gets the lock looks like this:
000000000045a770 :
  45a770:       31 d2                   xor    %edx,%edx
  45a772:       48 89 d0                mov    %rdx,%rax
  45a775:       f0 48 0f b1 3d 8a 12    lock cmpxchg
%rdi,1184394(%rip)        # 57ba08 
  45a77c:       12 00
  45a77e:       48 85 c0                test   %rax,%rax
  45a781:       75 ef                   jne    45a772 
  45a783:       f3 c3                   repz retq
  45a785:       66                      data16
  45a786:       66                      data16
  45a787:       66                      data16
  45a788:       90                      nop
  45a789:       66                      data16
  45a78a:       66                      data16
  45a78b:       66                      data16
  45a78c:       90                      nop
  45a78d:       66                      data16
  45a78e:       66                      data16
  45a78f:       90                      nop

000000000045a790 :
  45a790:       48 c7 05 6d 12 12 00    movq   $0x0,1184365(%rip)        #
57ba08 
  45a797:       00 00 00 00
  45a79b:       c3                      retq
  45a79c:       66                      data16
  45a79d:       66                      data16
  45a79e:       66                      data16
  45a79f:       90                      nop
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://ptlsim.org/pipermail/ptlsim-devel/attachments/20071106/fd5aea0e/attachment.htm 


More information about the PTLsim-devel mailing list