Skip to content

Build on Linux 7.1 and later - #120

Closed
randomizedcoder wants to merge 1 commit into
PlatformLab:mainfrom
randomizedcoder:fix/build-linux-7.1
Closed

randomizedcoder wants to merge 1 commit into
PlatformLab:mainfrom
randomizedcoder:fix/build-linux-7.1

Conversation

@randomizedcoder

Copy link
Copy Markdown
Contributor

Linux 7.1 changed two APIs that Homa uses, so main doesn't build on 7.1, 7.2 or 7.3:

  • proto.recvmsg lost addr_len (8341c989ac77). This adds homa_recvmsg_proto, a small adapter that does what sock_common_recvmsg used to: it starts addr_len at 0, calls homa_recvmsg, and sets msg->msg_namelen on success. homa_recvmsg and its unit tests are unchanged.
  • net_hotdata.rps_sock_flow_table became an rps_tag_ptr (dd378109d20f). homa_set_softirq_cpu now uses rps_tag_to_table/rps_tag_to_mask on 7.1+, mirroring the kernel's rps_record_sock_flow.

Builds against 6.12, 6.19.9, 7.0.14, 7.1.13, 7.2.12, 7.3-rc7 and 7.3, and the unit tests pass. Also loaded in a 7.3.0 VM, where loopback request/response RPCs (100 B to 1 MB) complete through the new recvmsg path and dmesg stays clean.

No test: compile-time only, and the unit harness builds against the 6.17.8/7.0.14 objects, where the new code isn't compiled.

Not covered here: 6.18 stable backported the recvmsg change in 6.18.40 and the sockaddr_unsized bind change in 6.18.57, so current 6.18 LTS still doesn't build. That needs a separate, finer-grained gate: test/mock.c uses SOCKADDR for connect, which 6.18.57 did not convert.

🤖 Generated with Claude Code

Linux 7.1 changed two APIs that Homa uses:

* proto.recvmsg lost its addr_len argument (8341c989ac77, "net: remove
  addr_len argument of recvmsg() handlers"); handlers now set
  msg->msg_namelen themselves. Add a small adapter, homa_recvmsg_proto,
  that does what sock_common_recvmsg used to do, so homa_recvmsg and its
  unit tests are unchanged.
* net_hotdata.rps_sock_flow_table became an rps_tag_ptr (dd378109d20f,
  "net-sysfs: use rps_tag_ptr and remove metadata from
  rps_sock_flow_table"). Use rps_tag_to_table/rps_tag_to_mask in
  homa_set_softirq_cpu, mirroring rps_record_sock_flow.

Builds against 6.12, 6.19, 7.2.9, 7.3-rc6 and 7.3; unit tests pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@breakertt

breakertt commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

There were some discussions on this between John and Tiara just recently #110 (comment)

I agree, and I also think we should move support from a random kernel version number (i.e. 6.17.8) to the latest LTS version, if we mainly maintain support for one kernel version.

I am trying to introduce some basic CI (#119) so we can quickly know when it doesn’t build.

But it still depends on John, as he is mainly working on this repo and his convenience matters most IMO.

@randomizedcoder

Copy link
Copy Markdown
Contributor Author

Thanks for the quick reply! I've got a flake.nix and modular nix that does a lot of static analysis, fuzzing, and will test against a wide range of kernels. This is easy to hook up with CI.

@breakertt

breakertt commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Unfortunately I am not a big fan of Nix, but I am also not anti-Nix. Overall I feel we should be able to have those abilities without Nix, for less maintenance burden. Do you think that if we use Nix for CI, the CI will still be easy to understand for non-NixOS users? If so, I am actually open to that.

@breakertt

Copy link
Copy Markdown
Contributor

Unfortunately I am not a big fan Nix, but I am also anti Nix. Just overall I feel we should able to have those abilities without Nix for less maintaince burden? Do you think if we use Nix for CI - the CI will easier to understand for non NixOS user? If so I am actually open to that.

Sorry I mean I am not anti-NixOS, it was a typo 🫣

@johnousterhout

Copy link
Copy Markdown
Member

Thanks for this patch. I'm doing some surgery on it (a) to use the homa_set_softirq_cpu code from the net-next branch (which has some comments to explain its behavior; the code is nearly identical and functionally equivalent) and (b) so that it strips cleanly for upstreaming (e.g. the HOMA_RECVMSG_NO_ADDR_LEN will be unacceptable in upstreamed code). When I push it (soon), can you check to be sure that I haven't broken anything?

Also, when the next LTS version is announced (perhaps in November?) my plan is to upgrade the main branch to that for development, and from then on use LTS versions as the primary version for development.

@breakertt

Copy link
Copy Markdown
Contributor

Next LTS - this year is tricky as 7.3 published in mid October so there maybe some uncertainty whether 7.3 is the last version year. Waiting for Greg’s decision.

@randomizedcoder

Copy link
Copy Markdown
Contributor Author

Checked main at 4bd0275 (includes e65a5c0 + 4e1ebd6) — nothing broken that I can find:

Check Result
Module build ✅ 6.12.113, 7.0.14, 7.1.13, 7.2.12, 7.3; __STRIP__=1 clean on 7.3
Unit tests ✅ 884/884 (IPv6 and --ipv4)
VM run, 7.3 ✅ echo 100 B–1 MB; netns/veth with GRO + RPS: 1737 homa_gro_receive, 470 homa_set_softirq_cpu calls (the rps_tag_ptr path)
VM run, 6.12 ✅ same, 1722 / 450 calls (the pre-7.1 path)

So both sides of the 7.1 gate work.

One thing relevant to the LTS plan: 6.18-stable backported both API changes (the recvmsg addr_len removal in 6.18.40, and sockaddr_unsized for bind in 6.18.57). With the < KERNEL_VERSION(7, 1, 0) / (7, 0, 0) gates, 6.18.57+ picks the old signatures and fails to build (incompatible-pointer-types is an error with gcc 15). If main moves to 7.3 or later this goes away; if 6.18 is the target I can send a small fix for the gates — just let me know which you'd prefer.

@breakertt re CI: agreed it should work without Nix — #119/#133 look like the right path. I'll keep the Nix tooling (multi-kernel builds, fuzzing, VM tests) on my fork and just report anything it finds.

randomizedcoder added a commit to randomizedcoder/HomaModule that referenced this pull request Oct 29, 2026
* analysis-reports/pr-tracker.md: all 17 upstream PRs (PlatformLab#94-PlatformLab#104,
  PlatformLab#120-PlatformLab#125), 16 landed, with the upstream commit for each, John's
  rework of PlatformLab#120, and its verification (build matrix, 884/884 unit
  tests, 7.3 and 6.12 microVMs with GRO/RPS).
* nix/patches: empty; the 7.1 port landed upstream as e65a5c0.
* fuzz-mock: known-findings is empty (PlatformLab#121 landed); the smoke gate now
  copes with an empty list instead of matching everything.
* round2 reports: mark landed; correct the unused-variable note.
* round4/candidates.md: next batch of eight hand-found bugs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
randomizedcoder added a commit to randomizedcoder/HomaModule that referenced this pull request Oct 29, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@johnousterhout

johnousterhout commented Oct 29, 2026 via email

Copy link
Copy Markdown
Member

randomizedcoder added a commit to randomizedcoder/HomaModule that referenced this pull request Oct 29, 2026
homa-vm-matrix runs every per-kernel smoke test and every cross-kernel
pair in parallel, each in its own directory (microvm.nix puts the QMP
socket in the cwd), and prints a summary table (verdict, echo, GRO
calls, cp_node rates) to the terminal and summary.md.

Its first run caught a use-after-free in homa_route_free on netns exit
and rmmod (STATUS.md F8; fix as fork draft #22). The guests now boot
with init_on_free=1, which turns that race into an oops on every run.

STATUS.md also records John's answer on PlatformLab#120: main will target an LTS
of 7.3 or later, so F1 (6.18 backports) is closed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

3 participants