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

Get rid of the possible/online CPUs mess #2033

Open
krizhanovsky opened this issue Jan 5, 2024 · 0 comments
Open

Get rid of the possible/online CPUs mess #2033

krizhanovsky opened this issue Jan 5, 2024 · 0 comments
Assignees
Labels
good to start Start form this tasks if you're new in Tempesta FW low priority performance
Milestone

Comments

@krizhanovsky
Copy link
Contributor

Motivation

The problem is addressed in #2023 (comment) : at the moment our code uses for_each_possible_cpu() in several places and even NR_CPUS, but it was never tested against (and even designed!) hot-plug or even switch on/off (e.g. with sysctl) CPUs. Some other places use for_each_online_cpus(). We have no idea whether Tempesta works with dynamically switched on/off or added/removed CPUs.

So in some cases we allocate extra memory for CPUs, which are never used. E.g. imagine how bad it is on basic Ubuntu 22:

$ grep 'CONFIG_NR_CPUS=\|CONFIG_HOTPLUG_CPU=' /boot/config-5.15.0-91-generic 
CONFIG_NR_CPUS=8192
CONFIG_HOTPLUG_CPU=y

Scope

Need to move to for_each_online_cpu() and remove NR_CPUS from fw/cache.c.

Testing

There is no need any specific testing, our regular CI is enough

Documentation

Probably it makes sense to update https://tempesta-tech.com/knowledge-base/Requirements/ if switching off CONFIG_HOTPLUG_CPU could provide any performance improvements due to simplified macros around the kernel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good to start Start form this tasks if you're new in Tempesta FW low priority performance
Projects
None yet
Development

No branches or pull requests

2 participants