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

koordlet: optimize perf group cpi collection #1905

Merged
merged 2 commits into from
Mar 4, 2024

Conversation

bowen-intel
Copy link
Contributor

Ⅰ. Describe what this PR does

By reusing unix.PerfEventAttr, we can decrease cgo calls, and remove goroutines to alleviate read pressure during CPI data collection.

Ⅱ. Does this pull request fix one issue?

fixes #1884

Ⅲ. Describe how to verify it

ps -eLf | grep koordlet | wc -l
pidstat -p xxx 1

Ⅳ. Special notes for reviews

V. Checklist

  • I have written necessary docs and comments
  • I have added necessary unit tests and integration tests
  • All checks passed in make test

Signed-off-by: bowen-intel <bowen.song@intel.com>
Signed-off-by: bowen-intel <bowen.song@intel.com>
Copy link

codecov bot commented Feb 20, 2024

Codecov Report

Attention: Patch coverage is 62.71186% with 22 lines in your changes are missing coverage. Please review.

Project coverage is 67.58%. Comparing base (ce9c870) to head (0711179).
Report is 19 commits behind head on main.

Files Patch % Lines
pkg/koordlet/util/perf_group/perf_group_linux.go 62.71% 16 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1905      +/-   ##
==========================================
+ Coverage   67.26%   67.58%   +0.31%     
==========================================
  Files         410      413       +3     
  Lines       45662    46171     +509     
==========================================
+ Hits        30715    31205     +490     
+ Misses      12734    12703      -31     
- Partials     2213     2263      +50     
Flag Coverage Δ
unittests 67.58% <62.71%> (+0.31%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zwzhang0107
Copy link
Contributor

@songtao98

@zwzhang0107
Copy link
Contributor

zwzhang0107 commented Feb 27, 2024

the fix looks good, it will be better if there are some comparison about performance before/after the fix.

also, dose PerfCollector has the same problem? @songtao98

@bowen-intel
Copy link
Contributor Author

the fix looks good, it will be better if there are some comparison about performance before/after the fix.

also, dose PerfCollector has the same problem? @songtao98

environment

图片

result

sudo perf trace -p `ps aux | grep koordlet | head -n 1 | awk '{print $2}'` -s -- sleep 360 # I just show one thread
ps -eLf | grep koordlet | wc -l

old version

图片 图片

new version

图片 图片

@zwzhang0107
Copy link
Contributor

/approve

@koordinator-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zwzhang0107

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@koordinator-bot koordinator-bot bot merged commit 2d34fc6 into koordinator-sh:main Mar 4, 2024
19 of 20 checks passed
ls-2018 pushed a commit to ls-2018/koordinator that referenced this pull request Mar 25, 2024
Signed-off-by: bowen-intel <bowen.song@intel.com>
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.

[issue] Optimize CPI collect in perfGroup
4 participants