-
Notifications
You must be signed in to change notification settings - Fork 5
memcg: reading memcg stats more efficiently #6148
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
memcg: reading memcg stats more efficiently #6148
Conversation
|
Upstream branch: 48a97ff |
AI reviewed your patch. Please fix the bug or email reply why it's not a bug. In-Reply-To-Subject: |
|
Forwarding comment 3407981460 via email |
|
Upstream branch: 48a97ff |
d0809e7 to
8c1f7b4
Compare
631bcf6 to
db45b16
Compare
|
Upstream branch: 48a97ff |
8c1f7b4 to
70788e1
Compare
db45b16 to
cf0c057
Compare
Reading from the memory.stat file can be expensive because of the string encoding/decoding and text filtering involved. Introduce three kfuncs for fetching each type of memcg stat from a bpf program. This allows data to be transferred directly to userspace, eliminating the need for string encoding/decoding. It also removes the need for text filtering since it allows for fetching specific stats. The patch also includes a kfunc for flushing stats in order to read the latest values. Note that this is not required for fetching stats, since the kernel periodically flushes memcg stats. It is left up to the programmer whether they want more recent stats or not. Signed-off-by: JP Kobryn <[email protected]> Acked-by: Shakeel Butt <[email protected]>
Add test coverage for the kfuncs that fetch memcg stats. Using some common stats, test before and after scenarios ensuring that the given stat increases by some arbitrary amount. The stats selected cover the three categories represented by the enums: node_stat_item, memcg_stat_item, vm_event_item. Since only a subset of all stats are queried, use a static struct made up of fields for each stat. Write to the struct with the fetched values when the bpf program is invoked and read the fields in the user mode program for verification. Signed-off-by: JP Kobryn <[email protected]>
|
Upstream branch: 48a97ff |
70788e1 to
64e845a
Compare
|
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=1012038 expired. Closing PR. |
Pull request for series with
subject: memcg: reading memcg stats more efficiently
version: 2
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1012038