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
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). mem_cgroup_from_sk returns NULL in that case. 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. 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: 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. Behaviour is unchanged when memcg is on.Checked:
__STRIP__=1, and against a KASAN/lockdep kernel.strip.py#elsefix from Strip the unit-test side of #ifndef __UNIT_TEST__ in strip.py #134 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