Skip to content

Fix/homa destroy ordering - #93

Open
acbk2b wants to merge 5 commits into
PlatformLab:mainfrom
acbk2b:fix/homa-destroy-ordering
Open

acbk2b wants to merge 5 commits into
PlatformLab:mainfrom
acbk2b:fix/homa-destroy-ordering

Conversation

@acbk2b

@acbk2b acbk2b commented Sep 17, 2026

Copy link
Copy Markdown

What?

Shared Homa state destroyed before namespace cleanup

  • On registration failure, homa_destroy() ran before unregister_pernet_subsys().
  • Unregistering invokes homa_net_exit() / homa_net_destroy(), which still require the shared Homa state.
  • Move homa_destroy() after the other unregister/cleanup operations.

Timetrace /proc state left behind on load failure

  • The error path did not call tt_destroy(), leaving stale proc entries and causing a delayed crash when accessed.
  • Call tt_destroy() in the error cleanup path, guarded by #ifndef __UPSTREAM__ because timetrace is excluded from the upstream kernel tree by util/strip.py.

tt_init() failure ignored

  • homa_load() did not check the result of tt_init().
  • Return immediately if tt_init() fails; no downstream Homa initialization has occurred, so the general cleanup path is unnecessary.

Also fixed a small bug in homa_rpc_ack__multiple_acks which attempted to destroy an uninitialized socket

Why?

The above bugs, combined with missing .netns_ok caused the Homa module to fail to load + crash my RHEL 8 test box.
.netns_ok is only applicable to RHEL8, however these changes are generally applicable to the module and are not exclusive to RHEL8

Each bug fix addressed a different failure mode the occurred during my testing. Stacking all of these fixes allowed me to successfully load the kernel module.

Testing?

I have added unit tests covering each bug to ensure a future regression would be detected

Anything else?

These changes will need to be back-merged into rhel8 as well

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

Successfully merging this pull request may close these issues.

1 participant