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

perf: reduce the cpu usage of collecting smaps and top #3

Open
yorkie opened this issue Dec 8, 2018 · 0 comments
Open

perf: reduce the cpu usage of collecting smaps and top #3

yorkie opened this issue Dec 8, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@yorkie
Copy link
Member

yorkie commented Dec 8, 2018

At linux, the /proc/{pid}/smaps causes the kernel to do iterations for every process. This looks awful and unneeded in our use case.

Assuming that we have 10 processes to collect, to work on all the 10 processes by the proc file system, the kernel actually does 10+ iterations on the same memory struct.

See torvalds/linux:fs/proc/task_mmu.c for details.

To reduce the current high cpu of collecting smaps, we only do 1 iteration for all process collections.

/cc @lolBig @FeelyChau

@yorkie yorkie added the enhancement New feature or request label Dec 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant