Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpf: Do not allocate percpu memory at init stage #662

Open
wants to merge 1 commit into
base: bpf-next_base
Choose a base branch
from

Conversation

danielocfb
Copy link
Owner

Pull request for series with
subject: bpf: Do not allocate percpu memory at init stage
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=800124

@danielocfb
Copy link
Owner Author

Upstream branch: 155addf
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=800124
version: 1

@danielocfb
Copy link
Owner Author

Upstream branch: 689b097
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=800124
version: 1

@danielocfb
Copy link
Owner Author

Upstream branch: 9241176
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=800124
version: 1

Kirill Shutemov reported significant percpu memory increase after booting
in 288-cpu VM ([1]) due to commit 41a5db8 ("bpf: Add support for
non-fix-size percpu mem allocation"). The percpu memory is increased
from 111MB to 969MB. The number is from /proc/meminfo.

I tried to reproduce the issue with my local VM which at most supports
upto 255 cpus. With 252 cpus, without the above commit, the percpu memory
immediately after boot is 57MB while with the above commit the percpu
memory is 231MB.

This is not good since so far percpu memory from bpf memory allocator
is not widely used yet. Let us change pre-allocation in init stage
to on-demand allocation when verifier detects there is a need of
percpu memory for bpf program. With this change, percpu memory
consumption after boot can be reduced signicantly.

  [1] https://lore.kernel.org/lkml/[email protected]/

Fixes: 41a5db8 ("bpf: Add support for non-fix-size percpu mem allocation")
Cc: Kirill A. Shutemov <[email protected]>
Signed-off-by: Yonghong Song <[email protected]>
@danielocfb danielocfb force-pushed the series/800124=>bpf-next branch from 0b9bc9d to 8cc180b Compare November 10, 2023 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant