-
Notifications
You must be signed in to change notification settings - Fork 397
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
Fix slow allocation of memory #2743
Conversation
Here's some data comparing times for Without this change:
With this change:
|
@genie-omr build zlinux plinux zlinux |
@genie-omr build xlinux |
Add more debugging details in findAvailableMemoryBlockNoMalloc Signed-off-by: Keith W. Campbell <[email protected]>
Signed-off-by: Keith W. Campbell <[email protected]>
Just use 'flag' instead of 'TRUE == flag'. Signed-off-by: Keith W. Campbell <[email protected]>
* use OMR_ARE_ANY_BITS_SET & OMR_ARE_NO_BITS_SET Signed-off-by: Keith W. Campbell <[email protected]>
The caller provides start and end addresses that constrain a non-null address that can be returned by the function. Internally, however, the function operates on ranges which are inclusive of the space requested by the caller: the allowed range must be initialized taking this difference into account by adding the requested block size to the end address. Signed-off-by: Keith W. Campbell <[email protected]>
It turns out the code isn't normally expected to take a path that leads to a (long) linear search for an acceptable allocation address: the problem was in We may someday want to introduce new behaviors for that backup search which is now encapsulated in some helper functions. BTW, the same problem was present in the ZTPF copy of omrvmem.c: it is now fixed too. |
@charliegracie - do we have the review? |
@genie-omr build xlinux |
@genie-omr build all |
@genie-omr build aix,zos |
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.
Approved. Just waiting for the CI to finish.
Some systems (e.g. Windows Subsystem for Linux) ignore the requested allocation address and repeatedly return the same address. When this happens we terminate the loop early to avoid excessive delays.
More recently, we've seen slow startup on z Linux as well. This change helps there too.
This is marked as 'WIP' because we need to understand what, if any, detrimental effects this has.