Harmony
  1. Harmony
  2. HARMONY-1942

[drlvm] Back-branch polling TLS offset is incorrect. Stability and performance fix

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: DRLVM
    • Labels:
      None

      Description

      The suspend flag's TLS offset used by JIT agorithms was incorrect after the latest merge of TM.
      As the result every loop iteration BBP algorithm uses slow path.

      This patch
      1) Fixes the problem
      2) Adds new functionality to TM: the UDATA VMCALL hythread_tls_get_offset(hythread_tls_key_t key) method.
      3) Removes jit_private data field from HyThread
      3) Fix JIT to always use allocation algorithm for TLS keys, not hardcoded values.

      1. hy.diff
        8 kB
        Mikhail Fursov
      2. hy_2.diff
        18 kB
        Mikhail Fursov

        Issue Links

          Activity

          Mikhail Fursov created issue -
          Hide
          Mikhail Fursov added a comment -

          The fix

          Show
          Mikhail Fursov added a comment - The fix
          Mikhail Fursov made changes -
          Field Original Value New Value
          Attachment hy.diff [ 12343502 ]
          Hide
          Mikhail Fursov added a comment -

          + More changes: the first patch is included into this patch

          1) exp file fixed on Linux. The first patch had an error.
          2) Both Jitrino compilers now use only tlsbase + offset method to check the flag.

          If no more problems will be found, the only patch to appy is hy_2.diff

          Show
          Mikhail Fursov added a comment - + More changes: the first patch is included into this patch 1) exp file fixed on Linux. The first patch had an error. 2) Both Jitrino compilers now use only tlsbase + offset method to check the flag. If no more problems will be found, the only patch to appy is hy_2.diff
          Mikhail Fursov made changes -
          Attachment hy_2.diff [ 12343529 ]
          Mikhail Fursov made changes -
          Link This issue blocks HARMONY-1949 [ HARMONY-1949 ]
          weldon washburn made changes -
          Assignee weldon washburn [ wjwashburn ]
          Hide
          weldon washburn added a comment -

          smoke tests pass on windowsxp and Linux w/ gcc 4.0.2

          Show
          weldon washburn added a comment - smoke tests pass on windowsxp and Linux w/ gcc 4.0.2
          weldon washburn made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Hide
          Mikhail Fursov added a comment -

          Verified.
          Thank you, Weldon.

          Show
          Mikhail Fursov added a comment - Verified. Thank you, Weldon.
          Hide
          Pavel Ozhdikhin added a comment -

          To complete the patch, the change below should be applied as well (already committed).

          Index: vm/jitrino/src/vm/VMInterface.cpp
          ===================================================================
          — vm/jitrino/src/vm/VMInterface.cpp (revision 468248)
          +++ vm/jitrino/src/vm/VMInterface.cpp (working copy)
          @@ -100,7 +100,7 @@
          DECL_HELPER_ITEM(ConvDtoI32),
          DECL_HELPER_ITEM(ConvDtoI64),
          DECL_HELPER_ITEM(EnableThreadSuspension),

          • DECL_HELPER_ITEM(GetSuspReqFlag),
            + DECL_HELPER_ITEM(GetTLSBase),
            DECL_HELPER_ITEM(MethodEntry),
            DECL_HELPER_ITEM(MethodExit),
            DECL_HELPER_ITEM(WriteBarrier),
          Show
          Pavel Ozhdikhin added a comment - To complete the patch, the change below should be applied as well (already committed). Index: vm/jitrino/src/vm/VMInterface.cpp =================================================================== — vm/jitrino/src/vm/VMInterface.cpp (revision 468248) +++ vm/jitrino/src/vm/VMInterface.cpp (working copy) @@ -100,7 +100,7 @@ DECL_HELPER_ITEM(ConvDtoI32), DECL_HELPER_ITEM(ConvDtoI64), DECL_HELPER_ITEM(EnableThreadSuspension), DECL_HELPER_ITEM(GetSuspReqFlag), + DECL_HELPER_ITEM(GetTLSBase), DECL_HELPER_ITEM(MethodEntry), DECL_HELPER_ITEM(MethodExit), DECL_HELPER_ITEM(WriteBarrier),
          Gavin made changes -
          Link This issue blocks HARMONY-1949 [ HARMONY-1949 ]
          Gavin made changes -
          Link This issue is depended upon by HARMONY-1949 [ HARMONY-1949 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Closed Closed
          2d 6h 48m 1 weldon washburn 26/Oct/06 14:29

            People

            • Assignee:
              weldon washburn
              Reporter:
              Mikhail Fursov
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development