Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-1942

MEMORY WRITE_BARRIER, READ_BARRIER and FULL_BARRIER related Patch for PPC64LE on RHEL

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: WT2.5.3, WT2.6.0
    • Fix Version/s: WT2.7.0
    • Labels:
      None
    • Environment:
      OS: Red Hat Enterprise Linux
      Arch: PPC64LE
    • # Replies:
      4
    • Last comment by Customer:
      true

      Description

      WiredTiger gives MEMORY WRITE BARRIER issues with PPC.

      This issue arises because there is no support for WT_WRITE_BARRIER, WT_READ_BARRIER and WT_FULL_BARRIER macros for PPC64. The macros are defined for Intel (mfence, sfence and lfence assembly instructions) but not for PPC64LE.

      So, I have made a patch with which WiredTiger 2.6.0 builds successfully.
      This patch applies to header file in path
      wiredtiger/src/include/gcc.h

      1. The replacement for mfence and sfence Intel instructions is "sync" instruction for PPC64.
      2. To avoid error related to "pause" instruction which is Intel instruction, I have copied it within Intel macro definitions and made a separate "WT_PAUSE" macro for PPC. The instruction "ORI" is called OR-Immediate and can be used as a NO-Operation by passing parameters "0,0,0". In documentation for PPC/Intel, it is mentioned that Pause can be replaced with No operation kind of behavior and hence the use of ORI

      Though it builds, I am not sure how to test it for PPC64 and confirm that "sync" and "ori" does the job

      Would appreciate your inputs on this patch.

      Thanks in advance.
      Anup Halarnkar

      1. gcc_h.patch
        1 kB
        Anup Halarnkar

        Issue Links

          Activity

          Hide
          alexander.gorrod Alexander Gorrod added a comment -

          Thanks for the patch Anup Halarnkar I've created a GitHub pull request with the patch in the WiredTiger repository here https://github.com/wiredtiger/wiredtiger/pull/1992.

          We'll need to figure out some way to compile/test the patch before it can be merged. Out of curiosity - why do you want to run on a PPC machine? Do you have hardware you can test on?

          Show
          alexander.gorrod Alexander Gorrod added a comment - Thanks for the patch Anup Halarnkar I've created a GitHub pull request with the patch in the WiredTiger repository here https://github.com/wiredtiger/wiredtiger/pull/1992 . We'll need to figure out some way to compile/test the patch before it can be merged. Out of curiosity - why do you want to run on a PPC machine? Do you have hardware you can test on?
          Hide
          anhal Anup Halarnkar added a comment -

          Yes, I am having PPC machine that I am working on. I was trying to build MongoDB ver 3.0. But faced issues with WiredTiger and V8 JavaScript engine. So, Initially I had to disable both during build and now I was trying to enable WiredTiger while keeping V8 disabled when I got Write Barrier issues which I uploaded the patch for.
          But, I cannot go any further as I am now facing issues with gperftools and v8 javascript engine. I had raised similar issues on respective websites beginning with MongoDB. Here are the links for your reference. Do let me know if you can provide any pointers to these issues too. I hope I am not asking for much

          https://jira.mongodb.org/browse/SERVER-17563?jql=project%20%3D%20SERVER%20AND%20priority%20%3D%20%22Major%20-%20P3%22%20AND%20resolution%20%3D%20Unresolved%20AND%20text%20~%20%22gperftools%22%20ORDER%20BY%20key%20DESC

          https://code.google.com/p/gperftools/issues/detail?id=691&thanks=691&ts=1432181070#makechanges

          http://code.google.com/p/v8/issues/detail?id=4123&thanks=4123&ts=1431928756

          Show
          anhal Anup Halarnkar added a comment - Yes, I am having PPC machine that I am working on. I was trying to build MongoDB ver 3.0. But faced issues with WiredTiger and V8 JavaScript engine. So, Initially I had to disable both during build and now I was trying to enable WiredTiger while keeping V8 disabled when I got Write Barrier issues which I uploaded the patch for. But, I cannot go any further as I am now facing issues with gperftools and v8 javascript engine. I had raised similar issues on respective websites beginning with MongoDB. Here are the links for your reference. Do let me know if you can provide any pointers to these issues too. I hope I am not asking for much https://jira.mongodb.org/browse/SERVER-17563?jql=project%20%3D%20SERVER%20AND%20priority%20%3D%20%22Major%20-%20P3%22%20AND%20resolution%20%3D%20Unresolved%20AND%20text%20~%20%22gperftools%22%20ORDER%20BY%20key%20DESC https://code.google.com/p/gperftools/issues/detail?id=691&thanks=691&ts=1432181070#makechanges http://code.google.com/p/v8/issues/detail?id=4123&thanks=4123&ts=1431928756
          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'agorrod', u'name': u'Alex Gorrod', u'email': u'alexg@wiredtiger.com'}

          Message: Add atomic implementations for PPC64 architecture.

          Based on patch submitted in WT-1942

          I haven't tested that this even compiles on PPC64 - we need to figure
          out how to do that regularly before merging this change.
          Branch: develop
          https://github.com/wiredtiger/wiredtiger/commit/0bcbdf317832a654d9b1e07f534a6a8f9e298ff9

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'agorrod', u'name': u'Alex Gorrod', u'email': u'alexg@wiredtiger.com'} Message: Add atomic implementations for PPC64 architecture. Based on patch submitted in WT-1942 I haven't tested that this even compiles on PPC64 - we need to figure out how to do that regularly before merging this change. Branch: develop https://github.com/wiredtiger/wiredtiger/commit/0bcbdf317832a654d9b1e07f534a6a8f9e298ff9
          Hide
          michael.cahill Michael Cahill added a comment -

          These changes have been merged and will be in the next release of WiredTiger and the next development release of MongoDB.

          Show
          michael.cahill Michael Cahill added a comment - These changes have been merged and will be in the next release of WiredTiger and the next development release of MongoDB.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                1 year, 39 weeks, 2 days ago
                Date of 1st Reply: