Repository navigation
Use mem_cgroup_from_sk in homa_rpc_alloc_server - #146
Open
randomizedcoder wants to merge 1 commit into
Open
randomizedcoder wants to merge 1 commit into
randomizedcoder wants to merge 1 commit into
Conversation
Member
|
This PR doesn't build on Homa's main branch (6.17.8): mem_cgroup_from_sk isn't present in that version of Linux. Can you modify it to behave properly when mem_cgroup_from_sk isn't present? |
Since Linux 6.18, struct sock has an sk_memcg field only when CONFIG_MEMCG is set, so homa_rpc_alloc_server failed to compile in kernels without memory cgroups (such as x86_64 and i386 defconfig). Use mem_cgroup_from_sk, which returns NULL in that case. That function doesn't exist before 6.18, where sk_memcg is unconditional, so keep reading the field there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
randomizedcoder
force-pushed
the
fix/rpc-memcg-without-config-memcg
branch
from
November 7, 2026 17:55
e550056 to
07b4cc6
Compare
randomizedcoder
added a commit
to randomizedcoder/HomaModule
that referenced
this pull request
Nov 7, 2026
Homa's README and CI name 6.17.8, and the matrix tested 6.12, 6.18 and 7.x, so it could not catch code that only builds on 6.18 and later (PlatformLab#146). BTF is off in this tree: its libbpf fails on current glibc, and a compile check doesn't need BTF. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
randomizedcoder
added a commit
to randomizedcoder/HomaModule
that referenced
this pull request
Nov 7, 2026
Homa's README and CI name 6.17.8, and the matrix tested 6.12, 6.18 and 7.x, so it could not catch code that only builds on 6.18 and later (PlatformLab#146). BTF is off in this tree: its libbpf fails on current glibc, and a compile check doesn't need BTF. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Thanks John, fixed. |
randomizedcoder
added a commit
to randomizedcoder/HomaModule
that referenced
this pull request
Nov 8, 2026
…fork #29) 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
struct sockhassk_memcgonly whenCONFIG_MEMCGis set (since 6.18). In a kernel without memory cgroups (x86_64 and i386 defconfig, for example),homa_rpc_alloc_serverdoesn't compile:The out-of-tree build only passes because distro kernels enable memcg.
Fix: from 6.18, read it with
mem_cgroup_from_sk(). UnderCONFIG_MEMCGthat returnssk->sk_memcg; without it, it returns NULL, so the allocation takes the existing non-accounted path. Before 6.18 the field is unconditional andmem_cgroup_from_sk()doesn't exist, so aLINUX_VERSION_CODEcheck reads the field directly. Behaviour is unchanged when memcg is on, and the stripped output is the 6.18+ form.Checked:
__STRIP__=1, and against a KASAN/lockdep 7.3 kernel. The previous version of this commit reproduces the 6.17mem_cgroup_from_skerror.HOMA=m,W=1; gcc + sparse, clang, i386) with no warnings, once a separate one-line fix for a new set-but-unused variable inhoma_pool.c(from the pool rework) is applied too; that one will follow as its own PR.No test, since it's a build fix.
🤖 Generated with Claude Code