Skip to content

lib: sbi: Add Sscpuutil (CPU Utilization) extension support#11

Open
Estherrzhang wants to merge 1 commit into
XUANTIE-RV:masterfrom
Estherrzhang:sscpuutil
Open

lib: sbi: Add Sscpuutil (CPU Utilization) extension support#11
Estherrzhang wants to merge 1 commit into
XUANTIE-RV:masterfrom
Estherrzhang:sscpuutil

Conversation

@Estherrzhang
Copy link
Copy Markdown

Add support for the Sscpuutil extension which enables frequency- invariant CPU utilization tracking by the OS scheduler.

The extension provides dedicated CSR counters (corecyc at 0xc30 and acttime at 0xc31) for computing CPU utilization. Their ratio gives:

effective_freq = ref_freq * (Dcycle / Dacttime)

Key implementation details:

  • Detect Sscpuutil by probing CSR_MACTTIME (0xb31).
  • Enable S/U-mode access via mcpuutilen (0x320) and scpuutilen (0x120).

Add support for the Sscpuutil extension which enables frequency-
invariant CPU utilization tracking by the OS scheduler.

The extension provides dedicated CSR counters (corecyc at 0xc30 and
acttime at 0xc31) for computing CPU utilization. Their ratio gives:

  effective_freq = ref_freq * (Dcycle / Dacttime)

Key implementation details:

- Detect Sscpuutil by probing CSR_MACTTIME (0xb31).
- Enable S/U-mode access via mcpuutilen (0x320) and scpuutilen (0x120).

Signed-off-by: Esther Z <zhangfengxue.zfx@alibaba-inc.com>
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