Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108620244
D30655.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
828 B
Referenced Files
None
Subscribers
None
D30655.diff
View Options
diff --git a/sys/riscv/riscv/mp_machdep.c b/sys/riscv/riscv/mp_machdep.c
--- a/sys/riscv/riscv/mp_machdep.c
+++ b/sys/riscv/riscv/mp_machdep.c
@@ -532,9 +532,9 @@
void
cpu_mp_setmaxid(void)
{
-#ifdef FDT
int cores;
+#ifdef FDT
cores = ofw_cpu_early_foreach(cpu_check_mmu, true);
if (cores > 0) {
cores = MIN(cores, MAXCPU);
@@ -543,12 +543,19 @@
mp_ncpus = cores;
mp_maxid = cores - 1;
cpu_enum_method = CPUS_FDT;
- return;
- }
+ } else
#endif
+ {
+ if (bootverbose)
+ printf("No CPU data, limiting to 1 core\n");
+ mp_ncpus = 1;
+ mp_maxid = 0;
+ }
- if (bootverbose)
- printf("No CPU data, limiting to 1 core\n");
- mp_ncpus = 1;
- mp_maxid = 0;
+ if (TUNABLE_INT_FETCH("hw.ncpu", &cores)) {
+ if (cores > 0 && cores < mp_ncpus) {
+ mp_ncpus = cores;
+ mp_maxid = cores - 1;
+ }
+ }
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 27, 10:43 PM (8 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16217708
Default Alt Text
D30655.diff (828 B)
Attached To
Mode
D30655: riscv: Add an hw.ncpu tunable to limit the number of cores
Attached
Detach File
Event Timeline
Log In to Comment