-
Notifications
You must be signed in to change notification settings - Fork 722
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
Define Portable SCC #7710
Comments
I guess the Portable SCC applies to persistent cache only. |
Is there a non-persistent SCC? |
Yes. But the default cache type is persistent on all platforms except z/OS. |
Ah right; then yeah, this is only relevant for the persistent cache. More specifically, only if the user wishes to make it portable. IMO I don't think we should enforce that the SCC is always portable since portability limits the amount of optimization that can be done. |
Notes from OpenJ9 community call:
For base layers of SCC, we want more broadly applicable AOT code.
Check:
Make compressedrefs independent of shift. Use a base register rather than a shift. |
@andrewcraik @mstoodle @vijaysun-omr @fjeremic could you guys take a look at #7710 (comment) ; what are your thoughts? |
Can you please elaborate on what this means? What does forcing compressed shift amount mean? |
that is going to be really bad for performance - variable width shifts on x86 are massively slower than fixed shifts. Worse still, most of the fixed shifts are folded into memrefs / leas which wouldn't be possible with the variable variant. Fixing the shift would make a lot more sense - could force 3 shift or 4 shift. Could just tell the GC to use the shift amount from the SCC instead.
Would result in way more barriers in general because some GC modes need a lot more barriers than the standard gencon. While you might be able to patch them out you will still have a loss of icache and footprint growth from all of this stuff.
agreed - for reasonable performance we would want the same policy with the same shift amount to allow the compiler to make reasonable assumptions. If there are good diagnostics from the cache when the user overrides the config on the command line it would make sense to just take the config from the cache unless the user specifies overrides on the command line which could then be vetted for compatibility IMO.
This is a lot of work for the x codegen and likely going to have a very bad impact on perf - I don't necessarily agree that this is the right way to go. I think fixing the shift and forcing shifts will give better performance. We only have to worry about 3 vs 4 shift then since that affects object alignment.
Not baking in that assumption seems reasonable to allow flexibility under AOT |
The idea is that regardless of the heap size, we set the shift to be a certain value (if in compressedrefs mode) |
There are also the other "big" JIT mode decisions like HCR support that will have to be decided. They can be enabled, but they will have a big impact on performance (esp since OSR isn't support with AOT yet). Similarly, field watch, FSD, etc. We may also want to make different choices in the virtual guards on methods to reduce the likelihood of guard patching? Something to think about anyway... |
Ok I suppose the question is under the portable SCC mode what do we care about more:
If we fix the compressedrefs shift under the portable SCC mode then AOT code performance will be good (in comparison) however JIT code performance will not be as good since we have an artificially large shift value. I'm also not sure of the performance delta of the GC. I do agree that fixing the shift value under portable SCC is definitely the easiest thing we can do to get started. |
If we don't go down the path described by [1] then what I'm envisioning we could do is what I described in [2]. Until features like OSR, FSD, etc. are enabled in AOT, then I think we should maintain the current approach of not loading AOT in those modes. [1] eclipse-omr/omr#4518 |
We had the first portable SCC workgroup meeting today (as decided in [1]). I've updated this PR's description with links to sub issues based on the points brought up where relevant discussions can happen. [1] https://openj9.slack.com/archives/C8312LCV9/p1574881291118000 |
The other issue that was mentioned during the workgroup discussion was that the SCC does timestamp checking for the JARs / modules file on first access. In Docker, we expect those checks to continue to pass (file timestamps aren't changed on image run) but are more likely to fail if the cache is manually copied. There are existing options to disable timestamp checking to work around the manual case. |
Using it is not a good idea, if any jar file changes, the changes will be ignored. Better to add support to update the cache with the new timestamps on a machine migration. |
For the majority of the time the SCC feature has existed, there was no real reason for the SCC to ever be moved from one machine to another. However, with the emergence of Docker containers it is much more likely that a SCC generated on one machine could be used on another. In fact, multi-layered SCCs (introduced in 0.17) facilitates such a workflow. However, because the SCC was never moved from one machine to another, it is not completely portable1. This high level issue exists to track the discussion and follow up work to define and implement a completely portable SCC.
The following is a list of ideas that worth discussing in the OpenJ9 Community Call; feel free to comment other ideas and I'll add it to the list.
-Xshareclasses
to denote "portable" mode.Sub Issues (Discussion):
Overall Principles:
1 - The lack of portability comes mostly from the stored AOT code; however, this issue tags other components because defining a portable SCC still requires coordination with the other components.
The text was updated successfully, but these errors were encountered: