-
Notifications
You must be signed in to change notification settings - Fork 423
Introduce max-cpu-num config item, remove all direct usages of axconfig::plat::CPU_NUM, use axplat to get cpu num. #317
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces runtime CPU number detection by replacing all direct usages of the compile-time constant axconfig::plat::CPU_NUM with a new runtime API axhal::cpu_num(). The configuration item is renamed from cpu-num to max-cpu-num to reflect that it now represents an upper limit rather than a fixed value.
Key changes:
- Introduced
axhal::cpu_num()andaxhal::init_cpu_num()for runtime CPU detection - Renamed configuration item from
plat.cpu-numtoplat.max-cpu-numacross all config files - Added
ax_get_cpu_num()API to the publicarceos_api::sysmodule - Updated platform crate dependencies from version 0.2 to 0.3
Reviewed changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
ulib/axstd/src/thread/mod.rs |
Updated available_parallelism() to use new ax_get_cpu_num() API |
scripts/make/config.mk |
Renamed config key from cpu-num to max-cpu-num with updated error messages |
modules/axtask/src/task.rs |
Changed task initialization to use runtime CPU mask via cpu_mask_full() |
modules/axtask/src/run_queue.rs |
Replaced compile-time CPU_NUM with runtime axhal::cpu_num() for array sizing and selection |
modules/axtask/src/api.rs |
Added CPU mask initialization logic using runtime CPU detection |
modules/axtask/Cargo.toml |
Removed lazyinit from multitask feature dependencies |
modules/axruntime/src/mp.rs |
Updated secondary CPU stack sizing to use MAX_CPU_NUM |
modules/axruntime/src/lib.rs |
Added init_cpu_num() call and removed hardcoded SMP display |
modules/axruntime/Cargo.toml |
Updated axplat dependency to version 0.3 |
modules/axipi/src/lib.rs |
Changed to use runtime axhal::cpu_num() instead of compile-time constant |
modules/axhal/src/lib.rs |
Implemented CPU number detection with CPU_NUM atomic and initialization logic |
modules/axhal/src/dummy.rs |
Added cpu_num() method to dummy power interface |
modules/axhal/build.rs |
Updated linker script generation to use MAX_CPU_NUM |
modules/axhal/Cargo.toml |
Updated platform crate dependencies to version 0.3 |
configs/dummy.toml |
Renamed cpu-num to max-cpu-num with updated documentation |
configs/custom/x86_64-pc-oslab.toml |
Renamed cpu-num to max-cpu-num with updated documentation |
api/arceos_posix_api/src/imp/sys.rs |
Updated sysconf to use runtime axhal::cpu_num() |
api/arceos_api/src/lib.rs |
Added ax_get_cpu_num() to sys module API |
api/arceos_api/src/imp/mod.rs |
Implemented ax_get_cpu_num() by re-exporting axhal::cpu_num |
Makefile |
Updated SMP parameter documentation |
Cargo.lock |
Updated platform crate dependencies to version 0.3 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 21 out of 22 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Replace #314, targeting main instead.