Skip to content

feat(config): add reclaimed CPU PSI eviction settings - #238

Closed
cheney-lin wants to merge 1 commit into
kubewharf:mainfrom
cheney-lin:feat/be-cpu-psi-eviction
Closed

cheney-lin wants to merge 1 commit into
kubewharf:mainfrom
cheney-lin:feat/be-cpu-psi-eviction

Conversation

@cheney-lin

@cheney-lin cheney-lin commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

What type of PR is this?

Feature

What this PR does / why we need it:

Adds optional spec.config.evictionConfig.beCPUPSIEvictionConfig settings for sustained reclaimed-cgroup CPU PSI full pressure: independent sampling, taint and soft-eviction switches; observation and dwell intervals; pressure/recovery thresholds; external-usage and idle gates; cooldown, proposal budget and grace period.

All fields are pointers so omission preserves agent defaults and explicit false/zero values survive configuration delivery. Numeric ranges are included in the generated CRD. Cross-field ordering and eviction-requires-taint validation belong to the consuming agent. This API change alone does not enable eviction.

Which issue(s) this PR fixes:

None.

Special notes for your reviewer:

Regenerated the AdminQoSConfiguration CRD with controller-gen v0.15.0 and config deepcopy with the repository-pinned k8s.io/code-generator v0.24.6. The generated deepcopy diff also normalizes existing function ordering and an equivalent slice copy.

Validation: go test -gcflags=all=-l -race ./pkg/apis/config/v1alpha1 passed with Go 1.26.5. The new test verifies JSON round trips, nil/false/zero preservation and non-aliasing for every pointer field. Generated outputs and git diff whitespace checks passed.

Consumers must upgrade the API module and installed CRD before using the new field.

I can’t confirm details such as generated CRD changes or test results from the supplied change summary alone.

Add optional AQC controls for sustained reclaimed cgroup CPU PSI pressure,
including taint, soft eviction, dwell times and proposal budgets. Preserve
omitted versus explicit false/zero fields and generate the CRD and deepcopy.

Assisted-by: Codex:gpt-6-astra
Co-authored-by: Codex <noreply@openai.com>
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between 68a56ec and 2dedaf0.

⛔ Files ignored due to path filters: 1
  • config/crd/bases/config.katalyst.kubewharf.io_adminqosconfigurations.yaml is excluded by !config/crd/bases/**
📒 Files selected for processing: 3
  • pkg/apis/config/v1alpha1/adminqos.go
  • pkg/apis/config/v1alpha1/be_cpu_psi_test.go
  • pkg/apis/config/v1alpha1/zz_generated.deepcopy.go

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The API adds optional BE CPU PSI eviction settings and deep-copy support. Tests cover explicit false and zero values, pointer independence, JSON round trips, and zero-value serialization.

API 新增可选的 BE CPU PSI 驱逐设置和深拷贝支持。测试覆盖显式 false 和零值、指针独立性、JSON 往返及零值序列化。

Changes

BE CPU PSI eviction configuration / BE CPU PSI 驱逐配置

Layer / File(s) Summary
Configuration contract and copy behavior / 配置契约与复制行为
pkg/apis/config/v1alpha1/adminqos.go, pkg/apis/config/v1alpha1/zz_generated.deepcopy.go, pkg/apis/config/v1alpha1/be_cpu_psi_test.go
EvictionConfig gains an optional BECPUPSIEvictionConfig field. The new type defines optional settings and numeric bounds, with comments stating relationships among thresholds and durations. Deep-copy methods copy the new pointer fields and nested config. Tests check deep-copy independence and JSON serialization. CATPolicy slice copying is adjusted. QoSLevelConfig and RDTConfig deep-copy methods are reordered; their copy behavior is unchanged.
EvictionConfig 新增可选的 BECPUPSIEvictionConfig 字段。新类型定义可选设置和数值范围,注释说明阈值与时长之间的关系。深拷贝方法复制新增指针字段和嵌套配置。测试检查深拷贝独立性和 JSON 序列化。调整 CATPolicy 切片复制。QoSLevelConfig 和 RDTConfig 深拷贝方法重新排序;其复制行为不变。

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Feature

Suggested reviewers: luomingmeng
建议审阅者: luomingmeng

Merge Risk: ⚪ Minimal · up to 2deda

No merge-blocking issue is identified; merge after normal validation of the API and generated CRD.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: adding reclaimed CPU PSI eviction settings to the configuration API.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cheney-lin cheney-lin closed this Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant