Skip to content

Lower optimization level workaround for omrzfs.c - #7639

Merged
babsingh merged 1 commit into
eclipse-omr:masterfrom
Deigue:openxl-omrzfs
Feb 19, 2025
Merged

babsingh merged 1 commit into
eclipse-omr:masterfrom
Deigue:openxl-omrzfs

Conversation

@Deigue

@Deigue Deigue commented Feb 3, 2025 •

Copy link
Copy Markdown
Contributor

Some functions containing the native call BPX4PCT are causing
a crash with Open XL, when they are called back to back in omrzfs. Instead
of lowering optimization level to O0 entirely, specifying
no inlining for these functions seems to mitigate this problem.
This will be used as a workaround until a permanent fix is
released.

Related: #7653

@Deigue
Deigue requested a review from babsingh as a code owner February 3, 2025 19:51
@babsingh

babsingh commented Feb 7, 2025

Copy link
Copy Markdown
Contributor

Using -O0 will result in significant performance regression. There should be separate documentation on the -O3 crash, tracked in a dedicated issue. This PR should be linked to that issue so it can be reverted once the -O3 crash is resolved. Additionally, have you explored modifying the source code in omrzfs.c to address the -O3 crash?

@babsingh

babsingh commented Feb 7, 2025

Copy link
Copy Markdown
Contributor

@joransiu What are your thoughts on this PR?

@Deigue

Deigue commented Feb 7, 2025

Copy link
Copy Markdown
Contributor Author

I have attempted to but unable to address it. Admittedly, I guess I can wrap the lowering of the optimization level restricted only to when using the Open XL compiler with (#define(__open_xl__)) so as to only really do this when absolutely necessary. That way I guess we won't be impacting all the ZOS instances.

@joransiu

joransiu commented Feb 7, 2025

Copy link
Copy Markdown
Contributor

To mitigate the performance impact, we can try to add __attribute__((optnone)) to the problematic function that Open XL has issues with: https://www.ibm.com/docs/en/open-xl-c-cpp-zos/2.1?topic=pragmas-pragma-option-override

@Deigue

Deigue commented Feb 18, 2025

Copy link
Copy Markdown
Contributor Author

I tried to disable just the inlining optimization for the functions, but it didn't seem to be working initially. After having a chat with Tony, I confirmed that I had to disable inlining for both the functions, in order to effectively disable the BPX4PCT calls to not cause a crash.

I just verified this today with my latest build that the new changes seem to work, and with these intact we can keep omrzfs.c at -O3 ... I've also updated the commit message and description to reflect the changes @babsingh

Comment thread port/zos390/omrzfs.c Resolved
@babsingh

Copy link
Copy Markdown
Contributor

Minor formatting issue in the commit message: released.. -> released.

Some functions containing the native call BPX4PCT are causing
a crash with Open XL, when they are called back to back in omrzfs. Instead
of lowering optimization level to O0 entirely, specifying
no inlining for these functions seems to mitigate this problem.
This will be used as a workaround until a permanent fix is
released.

Signed-off-by: Gaurav Chaudhari <gaurav.chaudhari@ibm.com>
@Deigue

Deigue commented Feb 19, 2025 •

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback, yes that is the correct flag. Tested the recommended changes (replaced both instances to conditional to open-xl) and also updated the commit description as suggested.

@babsingh

Copy link
Copy Markdown
Contributor

jenkins build all

@babsingh
babsingh merged commit f754fdd into eclipse-omr:master Feb 19, 2025
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