Skip to content
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

Trust maps file parser if no errors occur #4600

Merged
merged 1 commit into from
Nov 28, 2019

Conversation

dmitripivkine
Copy link
Contributor

If OMRPORT_VMEM_ALLOC_QUICK is used for virtual memory allocation we are
trying to find available memory interval by scanning maps file in
findAvailableMemoryBlockNoMalloc(). In case if it returns NULL (memory
interval with requested parameters is not available) we have choice to
trust this result and fail memory allocation request or continue with
slow allocation path to try any possible address range one by one.

In the past we noticed that sometimes (with unknown conditions
unfortunately) parser returns NULL, however slow path was able to
allocate memory eventually. So current code always execute slow path if
parsing fails. It creates possible delays in JVM startup time.

Currently parser in findAvailableMemoryBlockNoMalloc() can not
differentiate between cases parsing was complete with no error but no
memory range found or an error occur at the time of parsing. I believe
in first case we can trust parser results and fail allocation request
immediately. In second case however call of slow allocation path is
necessary.

So I am suggesting to add new output parameter that would report about
error occur at the parsing time.

Currently parser can not receive EOF condition because omrfile_read()
would mask it by returning -1. I added a recognition of EOF to parser.
Also I added a number of trace points to simplify analysis in case of
the failure in future. Please note that these trace points at the moment
because this call occur early in startup and Trace Engine has not been
initialized yet. However we are planning to fix this problem in the
future so these trace points become useful.

Also (by request from Service and have in mind we do not know why it
failed exactly) I added possibility to revert new behaviour to old one
by introducing a new key for Port Library. It will be used in case of
emergency to return back to old mode if this feature still be not
reliable enough.

Signed-off-by: Dmitri Pivkine Dmitri_Pivkine@ca.ibm.com

@dmitripivkine
Copy link
Contributor Author

@amicic @DanHeidinga @manqingl FYI

If OMRPORT_VMEM_ALLOC_QUICK is used for virtual memory allocation we are
trying to find available memory interval by scanning maps file in
findAvailableMemoryBlockNoMalloc(). In case if it returns NULL (memory
interval with requested parameters is not available) we have choice to
trust this result and fail memory allocation request or continue with
slow allocation path to try any possible address range one by one.

In the past we noticed that sometimes (with unknown conditions
unfortunately) parser returns NULL, however slow path was able to
allocate memory eventually. So current code always execute slow path if
parsing fails. It creates possible delays in JVM startup time. 

Currently parser in findAvailableMemoryBlockNoMalloc() can not
differentiate between cases parsing was complete with no error but no
memory range found or an error occur at the time of parsing. I believe
in first case we can trust parser results and fail allocation request
immediately. In second case however call of slow allocation path is
necessary.

So I am suggesting to add new output parameter that would report about
error occur at the parsing time. 

Currently parser can not receive EOF condition because omrfile_read()
would mask it by returning -1. I added a recognition of EOF to parser.
Also I added a number of trace points to simplify analysis in case of
the failure in future. Please note that these trace points at the moment
because this call occur early in startup and Trace Engine has not been
initialized yet. However we are planning to fix this problem in the
future so these trace points become useful.

Also (by request from Service and have in mind we do not know why it
failed exactly) I added possibility to revert new behaviour to old one
by introducing a new key for Port Library. It will be used in case of
emergency to return back to old mode if this feature still be not
reliable enough.

Signed-off-by: Dmitri Pivkine <Dmitri_Pivkine@ca.ibm.com>
@dmitripivkine
Copy link
Contributor Author

rebased to resolve conflict

@youngar
Copy link
Contributor

youngar commented Nov 27, 2019

@genie-omr build all

@youngar youngar merged commit 0614b71 into eclipse-omr:master Nov 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants