Skip to content

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

@dimakuv

Description

@dimakuv

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions