Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorder J9ZOS390 conditionals in AtomicSupport.hpp for Open XL z/OS #7640

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Deigue
Copy link
Contributor

@Deigue Deigue commented Feb 3, 2025

When Open XL AIX support was merged earlier, it seems to have caused problems with Open XL z/OS builds. The open_xl conditionals meant for AIX are taking priority over the J9ZOS390 clauses, causing problems for z/OS. Was recommended to reorder these so that the more granular J9ZOS390 conditional is encountered and entered first.

@Deigue Deigue force-pushed the openxl-fixaix branch 2 times, most recently from 94f4f8a to e845a75 Compare February 26, 2025 18:35
@Deigue Deigue requested a review from 0xdaryl February 26, 2025 18:36
@Deigue
Copy link
Contributor Author

Deigue commented Feb 26, 2025

@joransiu I attempted using the atomic Builtins , and read up on the memory options after asking around for some help.

Using different variants of memory options and trying a call similar to this restricted to open-xl

#if defined(__open_xl__)
        __atomic_compare_exchange((uint32_t *)address, (uint32_t *)&oldValue, (uint32_t *)&newValue, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
#endif /* defined(__open_xl__) */

But seems to be causing a hang at the end of the build, at the same place where explode-image would complete.
As such, I have kept it removed from this PR for now.

@Deigue
Copy link
Contributor Author

Deigue commented Feb 26, 2025

Updated PR to remove workaround that was in place.
Please review.

@Deigue
Copy link
Contributor Author

Deigue commented Mar 3, 2025

@0xdaryl Do the revised changes look good? I removed the workaround that was there for the older version of zOS, have kept the atomic suggestions away as it seemed to break the build.
@babsingh Does this look good/merge-ready? Just trying to push this one along as its one of the few remainders on the open-xl specific changes.

When Open XL AIX support was merged earlier, it seems to have
caused problems with Open XL z/OS builds. The __open_xl__
conditionals meant for AIX are taking priority over the
J9ZOS390 clauses, causing problems for z/OS. Was recommended
to reorder these so that the more granular J9ZOS390 conditional
is encountered and entered first.
The old volatile uint32_t workaround seems to be no longer valid
as the minimal zos version is 2.3, and is removed after testing
it works without the workaround.

Signed-off-by: Gaurav Chaudhari <[email protected]>
@Deigue
Copy link
Contributor Author

Deigue commented Mar 10, 2025

@babsingh Addressed the feedback from above, and corrected some additional comments around conditionals.

@Deigue Deigue requested a review from babsingh March 10, 2025 18:17
@babsingh
Copy link
Contributor

jenkins build all

Comment on lines +421 to +427
/* Call __csg directly as csg() does not exist. */
__csg((void*)&oldValue, (void*)address, (void*)&newValue);
return oldValue;
#else /* defined(OMR_ENV_DATA64) */
/* __cds1 does not write the swap value correctly, cds does the correct thing. */
cds((cds_t*)&oldValue, (cds_t*)address, *(cds_t*)&newValue);
return oldValue;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation is off. It doesn't match line 418 or 431.

Comment on lines +356 to +358
/* 390 cs() function defined in <stdlib.h>, doesn't expand properly to __cs1() which correctly deals with aliasing. */
__cs1((uint32_t *)&oldValue, (uint32_t *)address, (uint32_t *)&newValue);
return oldValue;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation is off over here as well. It doesn't match line 354 or 360.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants