Skip to content

Only count freed pages in homa_pool_free_bufs if not upstream - #149

Open
randomizedcoder wants to merge 1 commit into
PlatformLab:mainfrom
randomizedcoder:fix/pool-freed-pages-strip
Open

randomizedcoder wants to merge 1 commit into
PlatformLab:mainfrom
randomizedcoder:fix/pool-freed-pages-strip

Conversation

@randomizedcoder

Copy link
Copy Markdown
Contributor

freed_pages in homa_pool_free_bufs is read only by a tt_record4, which strip.py removes. The stripped file therefore fails to compile in a kernel tree with W=1 (gcc, clang and i386):

net/homa/homa_pool.c:361:13: error: variable 'freed_pages' set but not used [-Werror=unused-but-set-variable=]

It arrived with the pool rework in f67a4b4. The out-of-tree build and plain make __STRIP__=1 don't use W=1, so they still pass.

Fix: put the declaration and the increment inside #ifndef __UPSTREAM__ /* See strip.py */ blocks, so strip.py removes them along with the tt_record4. Not __STRIP__: compile-time stripping (make __STRIP__=1) keeps the tt_record4, so it still needs the variable. The source compiled in normal and __STRIP__=1 builds doesn't change.

Checked:

  • 886/886 unit tests pass, and 541/541 with __STRIP__=1.
  • make __STRIP__=1 builds the module.
  • The module builds against 6.17.8 and 7.3.
  • With Use mem_cgroup_from_sk in homa_rpc_alloc_server #146 as well, the stripped files build in a 7.3 tree (defconfig + HOMA=m, W=1; gcc + sparse, clang, i386) with no warnings.

No test, since it's a build fix.

🤖 Generated with Claude Code

freed_pages is read only by a tt_record4, which strip.py removes, so
the upstream source fails to compile with W=1:

  homa_pool.c: error: variable 'freed_pages' set but not used

Use __UPSTREAM__ rather than __STRIP__: compile-time stripping keeps
the tt_record4, so it still needs the variable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
randomizedcoder added a commit to randomizedcoder/HomaModule that referenced this pull request Nov 8, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
randomizedcoder added a commit to randomizedcoder/HomaModule that referenced this pull request Nov 8, 2026
nixpkgs 2026-11-07: kernels 6.12.116, 6.18.62, 7.3.3 (gcc 16.2, clang
21.1.8 unchanged). The kernel table in nix/README.md was missing the
6_17 tarball series added for Homa main's 6.17.8.

Checked: nix flake check; homa-tests 886/886; homa-module-7_3, -6_12,
-6_17, -debug; homa-build-matrix (6.1, 6.6, 6.18 fail as before);
homa-microvm-test PASS on 7.3.3; analysis-netdev W=1 shows only the
PlatformLab#146 and PlatformLab#149 errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
randomizedcoder added a commit to randomizedcoder/HomaModule that referenced this pull request Nov 8, 2026
nixpkgs 2026-11-07: kernels 6.12.116, 6.18.62, 7.3.3 (gcc 16.2, clang
21.1.8 unchanged). The kernel table in nix/README.md was missing the
6_17 tarball series added for Homa main's 6.17.8.

Checked: nix flake check; homa-tests 886/886; homa-module-7_3, -6_12,
-6_17, -debug; homa-build-matrix (6.1, 6.6, 6.18 fail as before);
homa-microvm-test PASS on 7.3.3; analysis-netdev W=1 shows only the
PlatformLab#146 and PlatformLab#149 errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
randomizedcoder added a commit to randomizedcoder/HomaModule that referenced this pull request Nov 9, 2026
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.

1 participant