-
Notifications
You must be signed in to change notification settings - Fork 396
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
Replace CPU APIs on Power #5197
Conversation
c12f923
to
76bfd7b
Compare
Will squash the new commits once my local tests pass. |
@mpirvu FYI, processor detection work on Power |
872aa2d
to
9a18900
Compare
Could you show the detected results from before and after this change? e.g. verbose log on a couple different hardwares (P7/P8/P9, LE/BE) Expected same results: CPU type, feature-set, and endian-ness. Blind testing is not enough, that is. |
The way I tested it was to add fatal asserts for every query then launch the build in our pool of power machines. (That's how I did it for all the platforms). The assert is basically old api against new api so it ensures that the new api always return the same result as the old api. If you don't think that's enough testing, then we can do what you suggested but I may need assistance on getting these hardwares. The test I have currently (as an example) TR_ASSERT_FATAL((_processorDescription.processor == p) == (self()->id() == self()->get_old_processor_type_from_new_processor_type(p)), "is test %d failed, id() %d, _processorDescription.processor %d", p, self()->id(), _processorDescription.processor); In this case new api is:
old api is:
and this is for Everytime the new api is invoked, we will run the old api to verify if the new api output is correct. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
we don't have any Atlas systems anywhere. old_processor (the old way) identifying Atlas seems something interestingly broken. |
I corrected my comment, not an atlas but an OMR_PROCESSOR_PPC_P6 query which is pretty common in the codebase. The old processor returns 16 which seems to be a bogus value. (TR_s370gp14, 16, z processor somehow). |
This comment has been minimized.
This comment has been minimized.
@genie-omr build all |
This comment has been minimized.
This comment has been minimized.
Going to check if this change breaks OpenJ9.. |
e7da235
to
88f08eb
Compare
This is not true unless I switch the power10 queries to the new api form which I won't do in this PR and I put the reasons in the following paragraph. (The old api's test against cpu.id() so even if we have cpu._processorDescription.processor == OMR_PPC_P10 it's not going to break anything)
|
93c0f40
to
82933d6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I'm happy with the current situation for POWER10 here, since a plan has been outlined for how this can be moved forward without breaking anything. Great work!
@genie-omr build all |
All checks passed. I will need to rebase to master (there was an OpenJ9 build break on Z) and verify with OpenJ9 to make sure nothing breaks. Will update when test finishes. |
Issue: eclipse-omr#4339 Signed-off-by: Harry Yu <harryyu1994@gmail.com>
82933d6
to
4259868
Compare
OpenJ9 tests passed on all platforms. We are good to go! |
@genie-omr build all |
@harryyu1994 can you confirm eclipse-openj9/openj9#9571 will not break following this merge? |
@fjeremic Just confirmed that eclipse-openj9/openj9#9571 works fine with this change. I assume you were asking this question to make sure no more omr dependencies is needed for eclipse-openj9/openj9#9571. |
Summary of changes: - Retire old version cpu detection code on Power - Move `CPU::getProcessorDescription()` to base J9CPU class as the 3 platforms (X, Z, Power) share the same code. There is no need to have 3 copies - Reasons for the removal: - We kept the old version because we wanted to make sure new version and old version give us the same behaviour - Now it's been a few month and we don't see any bugs with the new version there's no reason to keep the old version - Also we want to prevent developers from using the old version. Old design - Initializes the `TR_Processor` struct via j9port library - Initialization occurs in `TR_J9VM::initializeProcessorType()` - obtain cpu information using `CPU::TO_PORTLIB_getJ9ProcessorDesc()` - `TR::Compiler->target.cpu.setProcessor` to set processor - Fields and methods associated with the old design live in `Class CPU` - Common APIs: - `CPU::TO_PORTLIB_getJ9ProcessorDesc()` - `j9sysinfo_processor_has_feature(processorDesc, feature)` (j9port library API) - `CPU::id()` - `CPU::setProcessor(TR_Processor)` New design - Initializes the `OMRProcessorDesc` struct via omrport library - `CPU::detect()` to initialize `OMRProcessorDesc processorDescription` - `CPU::applyUserOptions()` to apply any debug options after initialization - `TR::Compiler->target.cpu` singleton variable that holds the CPU instance - `comp()->target().cpu` per compilation variable which is used for cross-cpu compilation support - For JIT we initialize `comp()->target().cpu` with `TR::Compiler->target.cpu` (Host CPU) - For AOT we initialize `comp()->target().cpu` with `TR::Compiler->relocatableTarget.cpu` (Portable CPU) - Fields and methods associated with the new design live in `Class CPU` - Common APIs: - `CPU::supportsFeature(feature)` - `CPU::isAtLeast(OMRProcessorArchitecture)` - Benefits: - Common to all 3 platforms - Simpler interface - Cross-CPU compilation support (Use one cpu for AOT and another for JIT) - The implementation for the new design is first introduced here eclipse-omr/omr#5197 and eclipse-openj9#9571 issue: eclipse-omr/omr#4339 depends on: eclipse-omr/omr#5547 Signed-off-by: Harry Yu <harryyu1994@gmail.com>
Issue: #4339
Signed-off-by: Harry Yu harryyu1994@gmail.com