Skip to content

(0.46.0) Improve x86 inline object allocations #19600

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

Merged
merged 16 commits into from
Jun 1, 2024

Conversation

0xdaryl
Copy link
Contributor

@0xdaryl 0xdaryl commented May 31, 2024

  • Call NoZeroInit anewarray helper when appropriate on x86
  • Misc. x86 allocation path improvements
  • Remove obsolete TR_EnableNewAllocationProfiling code
  • Misc. x86 allocation path improvements
  • Cleanup x86 object initialization path
  • Move x86 inlined allocation verification out of line
  • Move off-heap dataAddr allocation into a separate function
  • Use ScratchRegisterManager in x86 inline allocations
  • Misc. code cleanup for readability
  • Remove allocated object cache line alignment code on Power and x86
  • Remove deprecated shouldAlignTLHAlloc() checks on TR::Nodes
  • Compare variable array sizes as 32-bits for x86 inline allocations
  • Add knobs to disable x86 object allocation features
  • Misc. readability and formatting improvements to x86 inline allocation
  • Do not perform zero initialization of TLH objects when batch clearing enabled

Port of #19514

0xdaryl added 16 commits May 31, 2024 18:42
… enabled

Separates the notion of batch clearing from dual TLH on x86.  Assumes batch
clearing is enabled via the TR_EnableBatchClear environment variable.

Signed-off-by: Daryl Maier <[email protected]>
* Add an environment variable TR_DisableAllocationAlignment that disables cache
  line alignment of newly allocated objects
* Guard inline TLH prefetching code with CodeGenerator TLH prefetch enablement check

Signed-off-by: Daryl Maier <[email protected]>
In some cases, 64-bit comparisons were used which were inadvertently forcing
the out-of-line allocation path to be taken.  This was still functionally
correct, but poor for performance.

Ensure a 32-bit comparison is used.

Signed-off-by: Daryl Maier <[email protected]>
No longer set nor used anywhere in OMR or OpenJ9.

Signed-off-by: Daryl Maier <[email protected]>
The code has been disabled on Power for many years.

On x86, its performance was evaluated recently on modern Intel architectures
and found to be detrimental ito performance on allocation-intensive workloads.

The code is no longer useful and adds to technical debt, so remove it.

Signed-off-by: Daryl Maier <[email protected]>
This improves readability and code density of the inline allocation sequence.

Signed-off-by: Daryl Maier <[email protected]>
This improves readability and code density.

Signed-off-by: Daryl Maier <[email protected]>
* Remove dead code
* Rename genZeroInitObject|genZeroInitObject2 to
  genZeroInitEntireObject|genZeroInitEntireObject2 for clarity of purpose

Signed-off-by: Daryl Maier <[email protected]>
* Create a convenience function insertAllocationPrefetch() for inserting prefetches
* Rename genHeapAlloc2 to genHeapAllocNoArraylets
* Rename genHeapAlloc to genHeapAllocForDiscontiguousArraysOrRealtime
* Rename some variables for clarity
* Misc dead code removal and reformatting

Signed-off-by: Daryl Maier <[email protected]>
* Distinguish between "arraylet" and "hybrid arraylet" in naming where appropriate
* Various refactorings for readability and code density
* Eliminate obsolete comments

Signed-off-by: Daryl Maier <[email protected]>
Avoid REP STOS zero initialization for arrays whose length is below a prescribed
threshold checked at runtime.  Use faster GPR stores instead.  Move REP STOS
initialization out of line.

Signed-off-by: Daryl Maier <[email protected]>
If an anewarray allocation must be performed out-of-line, be sure
to call the NoZeroInit version if zero initialization can be avoided.

Signed-off-by: Daryl Maier <[email protected]>
@0xdaryl
Copy link
Contributor Author

0xdaryl commented May 31, 2024

@vijaysun-omr : please review/merge

@vijaysun-omr
Copy link
Contributor

Merging this change that was delivered to the head stream a couple of days back. @pshipton FYI.

@vijaysun-omr vijaysun-omr merged commit ba64f88 into eclipse-openj9:v0.46.0-release Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants