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

[PAL/vm-common] Do not malloc/free timeout objects but instead use an ever-growing array #2

Open
dimakuv opened this issue Jan 3, 2024 · 0 comments

Comments

@dimakuv
Copy link

dimakuv commented Jan 3, 2024

Description of the feature

Timeouts can be very frequent, and each timeout is malloced and later freed, which is a rather expensive op. See https://github.com/gramineproject/gramine-tdx/blob/intel_tdx/pal/src/host/vm-common/kernel_time.c, functions register_timeout() and deregister_timeout().

Instead, we can re-use the timeout objects, similarly to how we re-use thread stacks.

Why Gramine should implement it?

Timeouts are extensively used in futex() syscalls. And futex syscalls may be very frequent.

We may implement this optimization, but need to first make sure it can be a real bottleneck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant