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

fix(qrm): cpu plugin allocate for blocks according to calculated sequence #171

Merged
merged 3 commits into from
Jul 27, 2023

Conversation

csfldf
Copy link
Collaborator

@csfldf csfldf commented Jul 26, 2023

fix(qrm): cpu plugin allocate for blocks according to calculated sequence

@csfldf csfldf added bug Something isn't working workflow/need-review review: test succeeded, need to review labels Jul 26, 2023
@csfldf csfldf requested a review from waynepeking348 July 26, 2023 14:43
@csfldf csfldf self-assigned this Jul 26, 2023
@csfldf csfldf requested review from sun-yuliang and cheney-lin July 26, 2023 14:43
@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Patch coverage: 76.92% and project coverage change: -0.06% ⚠️

Comparison is base (2e80ceb) 50.97% compared to head (652fd4c) 50.92%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #171      +/-   ##
==========================================
- Coverage   50.97%   50.92%   -0.06%     
==========================================
  Files         418      418              
  Lines       40409    40478      +69     
==========================================
+ Hits        20600    20614      +14     
- Misses      17539    17605      +66     
+ Partials     2270     2259      -11     
Flag Coverage Δ
unittest 50.92% <76.92%> (-0.06%) ⬇️

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

Files Changed Coverage Δ
...u/dynamicpolicy/validator/validator_cpu_advisor.go 37.59% <40.00%> (ø)
...qrm-plugins/cpu/dynamicpolicy/cpuadvisor/helper.go 58.20% <75.30%> (+13.20%) ⬆️
...lugins/cpu/dynamicpolicy/policy_advisor_handler.go 35.63% <90.00%> (+0.59%) ⬆️
pkg/util/general/log.go 60.63% <100.00%> (+1.74%) ⬆️

... and 17 files with indirect coverage changes

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

}
return cpusets
}

// GetBlocks parses ListAndWatchResponse and returns map[int]map[string]*Block,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment should also be modified

entryName, subEntryName := namesTuple[0], namesTuple[1]

if isPod {
if subEntryName != "" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. use FakedContainerName instead of ""
  2. can this sorting logic be extracted to a separate function? (since both the four-layer loops and sorting logic are a little complicated)

// GetBlocks parses ListAndWatchResponse and returns map[int]map[string]*Block,
// the map is keyed as numa id -> block id -> block
func (lwr *ListAndWatchResponse) GetBlocks() (map[int]map[string]*Block, error) {
func (lwr *ListAndWatchResponse) GetBlocks() (map[int]map[string]*Block, map[int][]string, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why should still keep the previous returned value (i.e. map[int]map[string]*Block) here? just for legacy reasons or for coding convenience ?

@csfldf csfldf force-pushed the dev/cpu_block_alloc_seq branch 2 times, most recently from f9dafc8 to 6b9a058 Compare July 27, 2023 04:29
@csfldf csfldf force-pushed the dev/cpu_block_alloc_seq branch from 6b9a058 to aaecd01 Compare July 27, 2023 04:36
waynepeking348
waynepeking348 previously approved these changes Jul 27, 2023
luomingmeng
luomingmeng previously approved these changes Jul 27, 2023
@csfldf csfldf added workflow/merge-ready merge-ready: code is ready and can be merged and removed workflow/need-review review: test succeeded, need to review labels Jul 27, 2023
@waynepeking348 waynepeking348 dismissed stale reviews from luomingmeng and themself via 652fd4c July 27, 2023 05:49
@waynepeking348 waynepeking348 merged commit 085b466 into kubewharf:main Jul 27, 2023
luomingmeng pushed a commit to luomingmeng/katalyst-core that referenced this pull request Oct 11, 2024
…ence (kubewharf#171)

* fix(qrm): cpu plugin allocate for blocks according to calculated sequence

* fix(qrm): refine block sequence calculation by review comments

* fix concurrent testing issues for logging

---------

Co-authored-by: shaowei.wayne <shaowei.wayne@bytedance.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working workflow/merge-ready merge-ready: code is ready and can be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants