Skip to content

Optimize receive_msg_core() to a single walk over the entries #1603

Open

Description

@Koichi98

receive_msg_core() walks the entries twice: once backward to find where the subscriber's qos_depth deliverable messages start, once forward to hand them over oldest-first, so every entry in the range goes through find_publisher_info() twice. A single backward walk that keeps the last MAX_RECEIVE_NUM entries it accepts in a ring would cover it in one pass, at the cost of rewriting the delivery loop. Alternatively the ioctl could return the entries newest-first and let agnocastlib read the array in reverse, which is simpler still but changes the kmod/agnocastlib contract and has to keep ret_call_again able to walk a window wider than MAX_RECEIVE_NUM.

The second walk came in with #1602, where the smaller diff was preferred with a release close.

Activity

  1. added
    need-minor-updateInternal API breaking changes (heaphook/kmod/lib compatibility) - requires MINOR version update
    on Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    need-minor-updateInternal API breaking changes (heaphook/kmod/lib compatibility) - requires MINOR version update

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions