Skip to content

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

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

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

Conversation

@randomizedcoder

@randomizedcoder randomizedcoder commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

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:

No test, since it's a build fix.

🤖 Generated with Claude Code

randomizedcoder added a commit that referenced this pull request Nov 8, 2026
…fork #29)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
randomizedcoder force-pushed the fix/pool-freed-pages-strip branch from 10832a8 to fe8909b Compare November 8, 2026 17:48
@randomizedcoder randomizedcoder changed the title Only count freed pages in homa_pool_free_bufs if not stripped Only count freed pages in homa_pool_free_bufs if not upstream Nov 8, 2026
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