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

          Hide
          Mikhail Fursov added a comment -

          The fix

          Show
          Mikhail Fursov added a comment - The fix
          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
          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
          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),

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development